don't create piwik accounts with random gmail addresses, properly prefix the accounts so they're unique
This commit is contained in:
parent
fb9d6d8457
commit
dd6ace0c0c
|
@ -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));
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue