Open ghost opened 7 years ago
crontab -l 22 2 1,15 cd /home/guifi/public_html; /bin/sh copia_db_a_devel.sh; /usr/bin/mysql -uMASKED -pMASKED guifi66_devel < guifi66_devel_clean.sql; mysqldump -uMASKED -pMASKED guifi66_devel > guifi66_devel.sql; rm guifi66_devel.sql.gz; gzip guifi66_devel.sql;
guifi@www:~/public_html$ cat copia_db_a_devel.sh
DBUSER=MASKED DBPASSWORD=MASKED DBSNAME=MASKED DBNAME=guifi66_devel DBSERVER=localhost
fCreateTable=""
fInsertData=""
echo "Copying database ... (may take a while ...)"
DBCONN="-h ${DBSERVER} -u ${DBUSER} --password=${DBPASSWORD}"
echo "DROP DATABASE IF EXISTS ${DBNAME}" | mysql ${DBCONN}
echo "CREATE DATABASE ${DBNAME}" | mysql ${DBCONN}
for TABLE in echo "SHOW TABLES" | mysql $DBCONN $DBSNAME | tail -n +2
; do
createTable=echo "SHOW CREATE TABLE ${TABLE}"|mysql -B -r $DBCONN $DBSNAME|tail -n +2|cut -f 2-
fCreateTable="${fCreateTable} ; ${createTable}"
insertData="INSERT INTO ${DBNAME}.${TABLE} SELECT * FROM ${DBSNAME}.${TABLE}"
fInsertData="${fInsertData} ; ${insertData}"
done;
echo "$fCreateTable ; $fInsertData" | mysql $DBCONN $DBNAME
guifi@www:~/public_html$ cat guifi66_devel_clean.sql
ALTER TABLE users
DROP pass
;
ALTER TABLE users
DROP mail
;
ALTER TABLE users
DROP init
;
ALTER TABLE users
ADD pass
VARCHAR( 32 ) NOT NULL DEFAULT '2c57ea903930c8530a4c71af00b6e749' AFTER name
;
ALTER TABLE users
ADD mail
VARCHAR( 64 ) NOT NULL DEFAULT 'guifi@guifi.net' AFTER pass
;
ALTER TABLE users
ADD init
VARCHAR( 64 ) NOT NULL DEFAULT 'guifi@guifi.net' AFTER picture
;
UPDATE users
SET uid
= '0' WHERE name
= '';
etc..
etc..
etc..
right now all users have this mail: guifi@guifi.net
when you try to change a profile you cannot save it because should be unique. This can potentially produce more problems:
The proposal is to mask user's mail as:
<user>@guifi.net
Implement one of the two options: