Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

all users have the same mail #10

Open
ghost opened this issue Aug 26, 2017 · 1 comment
Open

all users have the same mail #10

ghost opened this issue Aug 26, 2017 · 1 comment

Comments

@ghost
Copy link

ghost commented Aug 26, 2017

right now all users have this mail: [email protected]

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:

  1. change it in script (would be nice if this is public) - @miquelmartos (?)
  2. change it in the building of the development environment
@miquelmartos
Copy link
Member

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
#!/bin/bash

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 '[email protected]' AFTER pass;
ALTER TABLE users ADD init VARCHAR( 64 ) NOT NULL DEFAULT '[email protected]' AFTER picture;
UPDATE users SET uid = '0' WHERE name = '';
etc..
etc..
etc..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant