Commit dd6ace0c authored by Antoine Beaupr��'s avatar Antoine Beaupr��

don't create piwik accounts with random gmail addresses, properly prefix the...

don't create piwik accounts with random gmail addresses, properly prefix the accounts so they're unique
parent fb9d6d84
......@@ -102,8 +102,7 @@ class m_piwik {
$user_login = $this->clean_user_name($user_login);
$user_pass = create_pass();
$user_mail = $user_mail ? $user_mail : $mem->user['mail'];
$user_mail = create_pass(4) . '@gmail.com'; // FIXME $user_mail; Unicité sur les emails ... Soit on ajoute + random soit, on prompt
$user_mail = $mem->user['mail'];
$user_alias = $user_login;
$api_data = $this->call_privileged_page('API', 'UsersManager.addUser', array('userLogin' => $user_login, 'password' => $user_pass, 'email' => $user_mail, 'alias' => $user_alias), 'JSON');
......@@ -345,10 +344,10 @@ class m_piwik {
/* Helper code FIXME: rename those function using "private" + "_" prefix */
/* return a clean username with a unique prefix per account */
function clean_user_name($username) {
return mysql_real_escape_string(trim($username));
global $admin, $cuid;
return 'alternc_' . $admin->get_login_by_uid($cuid) . '_' . mysql_real_escape_string(trim($username));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment