guifi / docker-drupal-guifi

Docker images for Drupal with drupal-guifi module enabled
2 stars 4 forks source link

all users have the same mail #10

Open ghost opened 7 years ago

ghost commented 7 years ago

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:

  1. change it in script (would be nice if this is public) - @miquelmartos (?)
  2. change it in the building of the development environment
miquelmartos commented 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

!/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 '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..