+
+
Index: /extensions/NBC_UserAdvManager/tags/2.11.1/include/constants.php
===================================================================
--- /extensions/NBC_UserAdvManager/tags/2.11.1/include/constants.php (revision 3875)
+++ /extensions/NBC_UserAdvManager/tags/2.11.1/include/constants.php (revision 3875)
@@ -0,0 +1,4 @@
+
Index: /extensions/NBC_UserAdvManager/tags/2.11.1/include/functions_UserAdvManager.inc.php
===================================================================
--- /extensions/NBC_UserAdvManager/tags/2.11.1/include/functions_UserAdvManager.inc.php (revision 3875)
+++ /extensions/NBC_UserAdvManager/tags/2.11.1/include/functions_UserAdvManager.inc.php (revision 3875)
@@ -0,0 +1,681 @@
+ '' ? $password : l10n('UserAdvManager_empty_pwd');
+
+ if ( function_exists('get_user_language_desc') and isset($conf_nbc_UserAdvManager[10]) and $conf_nbc_UserAdvManager[10] <> '' )
+ $infos1_perso = get_user_language_desc($conf_nbc_UserAdvManager[10])."\n\n";
+
+ break;
+
+ case 2:
+ $subject = '['.$conf['gallery_title'].'] '.l10n_args(get_l10n_args('Update of %s', $username));
+ $password = $password <> '' ? $password : l10n('UserAdvManager_empty_pwd');
+
+ break;
+
+ case 3:
+ $subject = '['.$conf['gallery_title'].'] '.l10n_args(get_l10n_args('Update of %s', $username));
+ $password = $password <> '' ? $password : l10n('UserAdvManager_no_update_pwd');
+
+ break;
+ }
+
+ if ( isset($conf_nbc_UserAdvManager[0]) and $conf_nbc_UserAdvManager[0] == 'true' )
+ {
+ $infos1 = array(
+ get_l10n_args('infos_mail %s', $username),
+ get_l10n_args('User: %s', $username),
+ get_l10n_args('Password: %s', $password),
+ get_l10n_args('Email: %s', $email),
+ get_l10n_args('', ''),
+ );
+ }
+
+
+ if ( isset($conf_nbc_UserAdvManager[2]) and $conf_nbc_UserAdvManager[2] == 'true' and $confirm)
+ {
+ $infos2 = array
+ (
+ get_l10n_args('Link: %s', AddConfirmMail($id, $email)),
+ get_l10n_args('', ''),
+ );
+
+ if ( function_exists('get_user_language_desc') and isset($conf_nbc_UserAdvManager[11]) and $conf_nbc_UserAdvManager[11] <> '' )
+ $infos2_perso = get_user_language_desc($conf_nbc_UserAdvManager[11])."\n\n";
+ }
+
+ pwg_mail($email, array(
+ 'subject' => $subject,
+ 'content' => (isset($infos1) ? $infos1_perso.l10n_args($infos1)."\n\n" : "").(isset($infos2) ? $infos2_perso.l10n_args($infos2)."\n\n" : "").get_absolute_root_url(),
+ ));
+
+/* ********************** */
+/* Email sending debugger */
+/* This is only to trace */
+/* the send of emails for */
+/* debugging */
+/* ********************** */
+// MailLog($email,$subject);
+/* ********************** */
+}
+
+
+/* Email sending debugger function */
+//function MailLog ($to, $subject)
+//{
+// $fo=fopen (NBC_UserAdvManager_PATH.'admin/maillog.txt','a') ;
+// fwrite($fo,"======================\n") ;
+// fwrite($fo,'le ' . date('D, d M Y H:i:s') . "\r\n");
+// fwrite($fo,$to . "\n" . $subject . "\r\n") ;
+// fclose($fo) ;
+ //return mail ($to,$subject) ;
+//}
+
+
+/* Function called from UserAdvManager_admin.php to resend validation email with or without new validation key */
+function ResendMail2User($typemail, $user_id, $username, $email, $confirm)
+{
+ global $conf;
+ $conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array();
+ $conf_nbc_UserAdvManager_ConfirmMail = isset($conf['nbc_UserAdvManager_ConfirmMail']) ? explode(";" , $conf['nbc_UserAdvManager_ConfirmMail']) : array();
+
+ include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php');
+
+ $infos1_perso = "";
+ $infos2_perso = "";
+
+ switch($typemail)
+ {
+ case 1:
+ $subject = '['.$conf['gallery_title'].'] '.l10n_args(get_l10n_args('Reminder_with_key_of_%s', $username));
+
+ if (function_exists('get_user_language_desc') and isset($conf_nbc_UserAdvManager_ConfirmMail[2]) and $conf_nbc_UserAdvManager_ConfirmMail[2] <> '' and isset($conf_nbc_UserAdvManager_ConfirmMail[3]) and $conf_nbc_UserAdvManager_ConfirmMail[3] == 'true' and $confirm)
+ {
+ $infos1 = get_user_language_desc($conf_nbc_UserAdvManager_ConfirmMail[2])."\n\n";
+
+ $infos2 = array
+ (
+ get_l10n_args('Link: %s', ResetConfirmMail($user_id)),
+ get_l10n_args('', ''),
+ );
+ }
+ break;
+
+ case 2:
+ $subject = '['.$conf['gallery_title'].'] '.l10n_args(get_l10n_args('Reminder_without_key_of_%s', $username));
+
+ if (function_exists('get_user_language_desc') and isset($conf_nbc_UserAdvManager_ConfirmMail[2]) and $conf_nbc_UserAdvManager_ConfirmMail[2] <> '' and isset($conf_nbc_UserAdvManager_ConfirmMail[3]) and $conf_nbc_UserAdvManager_ConfirmMail[3] == 'true' and !$confirm)
+ {
+ $infos1 = get_user_language_desc($conf_nbc_UserAdvManager_ConfirmMail[2])."\n\n";
+ }
+ break;
+ }
+ pwg_mail($email, array(
+ 'subject' => $subject,
+ 'content' => ($infos1."\n\n").(isset($infos2) ? l10n_args($infos2)."\n\n" : "").get_absolute_root_url(),
+ ));
+
+/* ********************** */
+/* Email sending debugger */
+/* This is only to trace */
+/* the send of emails for */
+/* debugging */
+/* ********************** */
+// MailLog($email,$subject);
+/* ********************** */
+}
+
+
+/* Function called from functions AddConfirmMail and ResetConfirmMail for validation key generation */
+function FindAvailableConfirmMailID()
+{
+ while (true)
+ {
+ $id = generate_key(16);
+ $query = "
+ SELECT COUNT(*)
+ FROM ".USER_CONFIRM_MAIL_TABLE."
+ WHERE id = '".$id."'
+ ;";
+ list($count) = mysql_fetch_row(pwg_query($query));
+
+ if ($count == 0)
+ return $id;
+ }
+}
+
+
+/* Function called from functions SendMail2User to process unvalidated users and generate validation key link */
+function AddConfirmMail($user_id, $email)
+{
+ global $conf;
+ $conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array();
+ $Confirm_Mail_ID = FindAvailableConfirmMailID();
+
+ list($dbnow) = mysql_fetch_row(pwg_query('SELECT NOW();'));
+
+ if (isset($Confirm_Mail_ID))
+ {
+ $query = "
+ SELECT status
+ FROM ".USER_INFOS_TABLE."
+ WHERE user_id = '".$user_id."'
+ ;";
+ list($status) = mysql_fetch_row(pwg_query($query));
+
+ $query = "
+ INSERT INTO ".USER_CONFIRM_MAIL_TABLE."
+ (id, user_id, mail_address, status, date_check)
+ VALUES
+ ('".$Confirm_Mail_ID."', '".$user_id."', '".$email."', '".$status."', null)
+ ;";
+ pwg_query($query);
+
+ $query = "
+ DELETE FROM ".USER_GROUP_TABLE."
+ WHERE user_id = '".$user_id."'
+ AND (
+ group_id = '".$conf_nbc_UserAdvManager[3]."'
+ OR
+ group_id = '".$conf_nbc_UserAdvManager[4]."'
+ )
+ ;";
+ pwg_query($query);
+
+ if (!is_admin() and $conf_nbc_UserAdvManager[9] <> -1)
+ {
+ $query = "
+ UPDATE ".USER_INFOS_TABLE."
+ SET status = '".$conf_nbc_UserAdvManager[9]."'
+ WHERE user_id = '".$user_id."'
+ ;";
+ pwg_query($query);
+ }
+
+ if ( $conf_nbc_UserAdvManager[3] <> -1 )
+ {
+ $query = "
+ INSERT INTO ".USER_GROUP_TABLE."
+ (user_id, group_id)
+ VALUES
+ ('".$user_id."', '".$conf_nbc_UserAdvManager[3]."')
+ ;";
+ pwg_query($query);
+ }
+
+ return get_absolute_root_url().NBC_UserAdvManager_PATH.'ConfirmMail.php?key='.$Confirm_Mail_ID;
+ }
+}
+
+
+/* Function called from UserAdvManager_admin.php to reset validation key */
+function ResetConfirmMail($user_id)
+{
+ global $conf;
+
+ $Confirm_Mail_ID = FindAvailableConfirmMailID();
+
+ list($dbnow) = mysql_fetch_row(pwg_query('SELECT NOW();'));
+
+ if (isset($Confirm_Mail_ID))
+ {
+ $query = "
+ UPDATE ".USER_CONFIRM_MAIL_TABLE."
+ SET id = '".$Confirm_Mail_ID."'
+ WHERE user_id = '".$user_id."'
+ ;";
+ pwg_query($query);
+
+ $query = "
+ UPDATE ".USER_INFOS_TABLE."
+ SET registration_date = '".$dbnow."'
+ WHERE user_id = '".$user_id."'
+ ;";
+ pwg_query($query);
+
+ return get_absolute_root_url().NBC_UserAdvManager_PATH.'ConfirmMail.php?key='.$Confirm_Mail_ID;
+ }
+}
+
+
+/* Function called from main.inc.php - Triggered on user deletion */
+function DeleteConfirmMail($user_id)
+{
+ $query = "
+ DELETE FROM ".USER_CONFIRM_MAIL_TABLE."
+ WHERE user_id = '".$user_id."'
+ ;";
+ pwg_query($query);
+}
+
+
+/* Function called from ConfirmMail.php to verify validation key used by user according time limit */
+function VerifyConfirmMail($id)
+{
+ global $conf;
+
+ include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
+
+ $conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array();
+ $conf_nbc_UserAdvManager_ConfirmMail = isset($conf['nbc_UserAdvManager_ConfirmMail']) ? explode(";" , $conf['nbc_UserAdvManager_ConfirmMail']) : array();
+
+ $query = "
+ SELECT COUNT(*)
+ FROM ".USER_CONFIRM_MAIL_TABLE."
+ WHERE id = '".$id."'
+ ;";
+ list($count) = mysql_fetch_row(pwg_query($query));
+
+ if ($count == 1)
+ {
+ $query = "
+ SELECT user_id, status, date_check
+ FROM ".USER_CONFIRM_MAIL_TABLE."
+ WHERE id = '".$id."'
+ ;";
+ $data = mysql_fetch_array(pwg_query($query));
+
+ if (!empty($data) and isset($data['user_id']) and !isset($data['date_check']))
+ {
+ $query = "
+ SELECT registration_date
+ FROM ".USER_INFOS_TABLE."
+ WHERE user_id = '".$data['user_id']."'
+ ;";
+ list($registration_date) = mysql_fetch_row(pwg_query($query));
+
+/* Time limit process */
+/* ****************** begin ******************* */
+ if (!empty($registration_date))
+ {
+ // Verify Confirmmail with time limit ON
+ if (isset ($conf_nbc_UserAdvManager_ConfirmMail[1]))
+ {
+ // dates formating and compare
+ $today = date("d-m-Y"); // Get today's date
+ list($day, $month, $year) = explode('-', $today); // explode date of today
+ $daytimestamp = mktime(0, 0, 0, $month, $day, $year);// Generate UNIX timestamp
+
+ list($regdate, $regtime) = explode(' ', $registration_date); // Explode date and time from registration date
+ list($regyear, $regmonth, $regday) = explode('-', $regdate); // Explode date from registration date
+ $regtimestamp = mktime(0, 0, 0, $regmonth, $regday, $regyear);// Generate UNIX timestamp
+
+ $deltasecs = $daytimestamp - $regtimestamp;// Compare the 2 UNIX timestamps
+ $deltadays = floor($deltasecs / 86400);// Convert result from seconds to days
+
+ // Condition with the value set for time limit
+ if ($deltadays <= $conf_nbc_UserAdvManager_ConfirmMail[1]) // If Nb of days is less than the limit set
+ {
+ list($dbnow) = mysql_fetch_row(pwg_query('SELECT NOW();'));
+
+ $query = '
+ UPDATE '.USER_CONFIRM_MAIL_TABLE.'
+ SET date_check="'.$dbnow.'"
+ WHERE id = "'.$id.'"
+ ;';
+ pwg_query($query);
+
+ if ($conf_nbc_UserAdvManager[3] <> -1)
+ {
+ $query = "
+ DELETE FROM ".USER_GROUP_TABLE."
+ WHERE user_id = '".$data['user_id']."'
+ AND group_id = '".$conf_nbc_UserAdvManager[3]."'
+ ;";
+ pwg_query($query);
+ }
+
+ if ($conf_nbc_UserAdvManager[4] <> -1) // Change user's group
+ {
+ $query = "
+ DELETE FROM ".USER_GROUP_TABLE."
+ WHERE user_id = '".$data['user_id']."'
+ AND group_id = '".$conf_nbc_UserAdvManager[4]."'
+ ;";
+ pwg_query($query);
+
+ $query = "
+ INSERT INTO ".USER_GROUP_TABLE."
+ (user_id, group_id)
+ VALUES
+ ('".$data['user_id']."', '".$conf_nbc_UserAdvManager[4]."')
+ ;";
+ pwg_query($query);
+ }
+
+ if (($conf_nbc_UserAdvManager[5] <> -1 or isset($data['status']))) // Change user's status
+ {
+ $query = "
+ UPDATE ".USER_INFOS_TABLE."
+ SET status = '".(isset($data['status']) ? $data['status'] : $conf_nbc_UserAdvManager[5])."'
+ WHERE user_id = '".$data['user_id']."'
+ ;";
+ pwg_query($query);
+ }
+ // Refresh user's category cache
+ invalidate_user_cache();
+
+ return true;
+ }
+ elseif ($deltadays > $conf_nbc_UserAdvManager_ConfirmMail[1]) // If timelimit exeeds
+ {
+ return false;
+ }
+ }
+ // Verify Confirmmail with time limit OFF
+ else
+ {
+ list($dbnow) = mysql_fetch_row(pwg_query('SELECT NOW();'));
+
+ $query = '
+ UPDATE '.USER_CONFIRM_MAIL_TABLE.'
+ SET date_check="'.$dbnow.'"
+ WHERE id = "'.$id.'"
+ ;';
+ pwg_query($query);
+
+ if ($conf_nbc_UserAdvManager[3] <> -1)
+ {
+ $query = "
+ DELETE FROM ".USER_GROUP_TABLE."
+ WHERE user_id = '".$data['user_id']."'
+ AND group_id = '".$conf_nbc_UserAdvManager[3]."'
+ ;";
+ pwg_query($query);
+ }
+
+ if ($conf_nbc_UserAdvManager[4] <> -1)
+ {
+ $query = "
+ DELETE FROM ".USER_GROUP_TABLE."
+ WHERE user_id = '".$data['user_id']."'
+ AND group_id = '".$conf_nbc_UserAdvManager[4]."'
+ ;";
+ pwg_query($query);
+
+ $query = "
+ INSERT INTO ".USER_GROUP_TABLE."
+ (user_id, group_id)
+ VALUES
+ ('".$data['user_id']."', '".$conf_nbc_UserAdvManager[4]."')
+ ;";
+ pwg_query($query);
+ }
+
+ if (($conf_nbc_UserAdvManager[5] <> -1 or isset($data['status'])))
+ {
+ $query = "
+ UPDATE ".USER_INFOS_TABLE."
+ SET status = '".(isset($data['status']) ? $data['status'] : $conf_nbc_UserAdvManager[5])."'
+ WHERE user_id = '".$data['user_id']."'
+ ;";
+ pwg_query($query);
+ }
+ // Refresh user's category cache
+ invalidate_user_cache();
+
+ return true;
+ }
+ }
+ }
+ }
+ else
+ return false;
+}
+
+/* Function called from UserAdvManager_admin.php to force users validation by admin */
+function ForceValidation($id)
+{
+ global $conf;
+
+ include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
+
+ $conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array();
+
+ $query = "
+ SELECT COUNT(*)
+ FROM ".USER_CONFIRM_MAIL_TABLE."
+ WHERE user_id = '".$id."'
+ ;";
+ list($count) = mysql_fetch_row(pwg_query($query));
+
+ if ($count == 1)
+ {
+ $query = "
+ SELECT user_id, status, date_check
+ FROM ".USER_CONFIRM_MAIL_TABLE."
+ WHERE user_id = '".$id."'
+ ;";
+ $data = mysql_fetch_array(pwg_query($query));
+
+ if (!empty($data) and isset($data['user_id']) and !isset($data['date_check']))
+ {
+ list($dbnow) = mysql_fetch_row(pwg_query('SELECT NOW();'));
+
+ $query = "
+ UPDATE ".USER_CONFIRM_MAIL_TABLE."
+ SET date_check='".$dbnow."'
+ WHERE user_id = '".$data['user_id']."'
+ ;";
+ pwg_query($query);
+
+ if ($conf_nbc_UserAdvManager[3] <> -1)
+ {
+ $query = "
+ DELETE FROM ".USER_GROUP_TABLE."
+ WHERE user_id = '".$data['user_id']."'
+ AND group_id = '".$conf_nbc_UserAdvManager[3]."'
+ ;";
+ pwg_query($query);
+ }
+
+ if ($conf_nbc_UserAdvManager[4] <> -1)
+ {
+ $query = "
+ DELETE FROM ".USER_GROUP_TABLE."
+ WHERE user_id = '".$data['user_id']."'
+ AND group_id = '".$conf_nbc_UserAdvManager[4]."'
+ ;";
+ pwg_query($query);
+
+ $query = "
+ INSERT INTO ".USER_GROUP_TABLE."
+ (user_id, group_id)
+ VALUES
+ ('".$data['user_id']."', '".$conf_nbc_UserAdvManager[4]."')
+ ;";
+ pwg_query($query);
+ }
+
+ if (($conf_nbc_UserAdvManager[5] <> -1 or isset($data['status'])))
+ {
+ $query = "
+ UPDATE ".USER_INFOS_TABLE."
+ SET status = '".(isset($data['status']) ? $data['status'] : $conf_nbc_UserAdvManager[5])."'
+ WHERE user_id = '".$data['user_id']."'
+ ;";
+ pwg_query($query);
+ }
+ // Refresh user's category cache
+ invalidate_user_cache();
+ return true;
+ }
+ }
+}
+
+/* Function called from main.inc.php - Get username case insensitive */
+function NotSensibleSearchUsername($username)
+{
+ global $conf;
+
+ if (isset($username))
+ {
+ $query = "
+ SELECT ".$conf['user_fields']['username']."
+ FROM ".USERS_TABLE."
+ WHERE LOWER(".$conf['user_fields']['username'].") = '".strtolower($username)."'
+ ;";
+ list($username) = mysql_fetch_row(pwg_query($query));
+
+ return isset($username) ? $username : '';
+ }
+}
+
+
+/* Obsolete function - Check for single email in database */
+function SearchMail($email)
+{
+ global $conf, $lang;
+
+ if (isset($email))
+ {
+ $query = "
+ SELECT COUNT(*)
+ FROM ".USERS_TABLE."
+ WHERE ".$conf['user_fields']['email']." = '".$email."'
+ ;";
+ list($nbr_mail) = mysql_fetch_row(pwg_query($query));
+
+ return isset($nbr_mail) ? $nbr_mail : 0;
+ }
+}
+
+
+/* Function called from main.inc.php - Check if username matches forbidden caracters */
+function ValidateUsername($login)
+{
+ global $conf;
+
+ $conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array();
+
+ if (isset($login) and isset($conf_nbc_UserAdvManager[8]) and $conf_nbc_UserAdvManager[8] <> '')
+ {
+ $pattern = '/'.$conf_nbc_UserAdvManager[8].'/';
+ if ( preg_match($pattern, $login) )
+ return false;
+ else
+ return true;
+ }
+ else
+ {
+ return true;
+ }
+}
+
+
+/* Obsolete function - Check for no forbidden email provider */
+/* This don't work on function call */
+function ValidateEmailProvider($email)
+{
+ global $conf;
+
+ $conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array();
+ if (isset($conf_nbc_UserAdvManager[12]))
+ {
+ $ncsemail = strtolower($email);
+ $conf_nbc_MailExclusion = preg_split('/,/',$conf_nbc_UserAdvManager[13]);
+ for ($i = 0 ; $i < count($conf_nbc_MailExclusion) ; $i++)
+ {
+ $pattern = '/'.$conf_nbc_MailExclusion[$i].'/';
+ if (preg_match($pattern, $ncsemail))
+ return false;
+ else
+ return true;
+ }
+ }
+}
+
+
+/* Function called from UserAdvManager.php - Get unvalidated users according time limit */
+function get_unvalid_user_list()
+{
+ global $conf, $page;
+
+ /* Get ConfirmMail configuration */
+ $conf_nbc_UserAdvManager_ConfirmMail = isset($conf['nbc_UserAdvManager_ConfirmMail']) ? explode(";" , $conf['nbc_UserAdvManager_ConfirmMail']) : array();
+
+ /* Get UserAdvManager configuration */
+ $conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array();
+
+ $users = array();
+
+ /* search users depending expiration date */
+ $query = '
+ SELECT DISTINCT u.'.$conf['user_fields']['id'].' AS id,
+ u.'.$conf['user_fields']['username'].' AS username,
+ u.'.$conf['user_fields']['email'].' AS email,
+ ui.status,
+ ui.adviser,
+ ui.enabled_high,
+ ui.level,
+ ui.registration_date,
+ ug.group_id
+ FROM '.USERS_TABLE.' AS u
+ INNER JOIN '.USER_INFOS_TABLE.' AS ui
+ ON u.'.$conf['user_fields']['id'].' = ui.user_id
+ INNER JOIN '.USER_GROUP_TABLE.' AS ug
+ ON u.'.$conf['user_fields']['id'].' = ug.user_id
+ WHERE u.'.$conf['user_fields']['id'].' >= 0
+ AND ug.group_id = "'.$conf_nbc_UserAdvManager[3].'"
+ AND TO_DAYS(NOW()) - TO_DAYS(ui.registration_date) >= "'.$conf_nbc_UserAdvManager_ConfirmMail[1].'"
+ ORDER BY id ASC
+ ;';
+
+ $result = pwg_query($query);
+
+ while ($row = mysql_fetch_array($result))
+ {
+ $user = $row;
+ $user['groups'] = array();
+
+ array_push($users, $user);
+ }
+
+ /* add group lists */
+ $user_ids = array();
+ foreach ($users as $i => $user)
+ {
+ $user_ids[$i] = $user['id'];
+ }
+
+ $user_nums = array_flip($user_ids);
+
+ if (count($user_ids) > 0)
+ {
+ $query = '
+ SELECT user_id, group_id
+ FROM '.USER_GROUP_TABLE.'
+ WHERE user_id IN ('.implode(',', $user_ids).')
+ ;';
+
+ $result = pwg_query($query);
+
+ while ($row = mysql_fetch_array($result))
+ {
+ array_push(
+ $users[$user_nums[$row['user_id']]]['groups'],
+ $row['group_id']
+ );
+ }
+ }
+
+ return $users;
+}
+?>
Index: /extensions/NBC_UserAdvManager/tags/2.11.1/include/index.php
===================================================================
--- /extensions/NBC_UserAdvManager/tags/2.11.1/include/index.php (revision 3875)
+++ /extensions/NBC_UserAdvManager/tags/2.11.1/include/index.php (revision 3875)
@@ -0,0 +1,33 @@
+
Index: /extensions/NBC_UserAdvManager/tags/2.11.1/index.php
===================================================================
--- /extensions/NBC_UserAdvManager/tags/2.11.1/index.php (revision 3875)
+++ /extensions/NBC_UserAdvManager/tags/2.11.1/index.php (revision 3875)
@@ -0,0 +1,33 @@
+
Index: /extensions/NBC_UserAdvManager/tags/2.11.1/language/en_UK/index.php
===================================================================
--- /extensions/NBC_UserAdvManager/tags/2.11.1/language/en_UK/index.php (revision 3875)
+++ /extensions/NBC_UserAdvManager/tags/2.11.1/language/en_UK/index.php (revision 3875)
@@ -0,0 +1,33 @@
+
Index: /extensions/NBC_UserAdvManager/tags/2.11.1/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/NBC_UserAdvManager/tags/2.11.1/language/en_UK/plugin.lang.php (revision 3875)
+++ /extensions/NBC_UserAdvManager/tags/2.11.1/language/en_UK/plugin.lang.php (revision 3875)
@@ -0,0 +1,132 @@
+(!!! WARNING ! Use the multi language tags from Extended Description plugin if this plugin is activated !!!)';
+$lang['UserAdvManager_No_Casse'] = ' User insensitive';
+$lang['UserAdvManager_No_Casse_true'] = ' Make the user account insensitive at the registration and the identification step';
+$lang['UserAdvManager_No_Casse_false'] = ' Let the user-sensitive.';
+$lang['UserAdvManager_Username_Char'] = ' Limited charset for unsername';
+$lang['UserAdvManager_Username_Char_true'] = ' The following characters will be forbidden for username choice';
+$lang['UserAdvManager_Username_Char_false'] = ' Use the default username charset control.';
+$lang['UserAdvManager_Confirm_Mail'] = 'Email address confirmation';
+$lang['UserAdvManager_Confirm_Mail_true'] = ' Send an email to user to allow him to validate his email and his registration.';
+$lang['UserAdvManager_Confirm_Mail_false'] = ' Use the default Piwigo registration system (without registration validation).';
+$lang['UserAdvManager_ConfirmMail_Text'] = 'Text used to introduce the email sent to user to allow him to validate his email address (!!! WARNING ! Use the multi language tags from Extended Description plugin if this plugin is activated !!!)';
+$lang['UserAdvManager_No_Confirm_Group'] = 'Group to use for the users who haven\'t validated their email address.';
+$lang['UserAdvManager_Validated_Group'] = 'Group to use for the users who have validated their email address.';
+$lang['UserAdvManager_No_Confirm_Status'] = 'Status to use for the users who haven\'t validated their email address.';
+$lang['UserAdvManager_Validated_Status'] = 'Status to use for the users who have validated their email address. Let ------- for using default Piwigo values';
+$lang['UserAdvManager_No_Comment_Anonymous'] = 'Nickname are mandatory for comments';
+$lang['UserAdvManager_No_Comment_Anonymous_true'] = ' The author field have to be filled to send a comment.';
+$lang['UserAdvManager_No_Comment_Anonymous_false'] = ' Use the default Piwigo settings on comments sending.';
+$lang['UserAdvManager_MailExclusion'] = 'Email provider exclusion';
+$lang['UserAdvManager_MailExclusion_true'] = ' Set the email provider exclusion ON (i.e. : @hotmail.* or @msn.*)';
+$lang['UserAdvManager_MailExclusion_false'] = ' Set the email provider exclusion OFF.';
+$lang['UserAdvManager_MailExclusion_List'] = ' If email provider exclusion is set to ON, fill the email domains to exclude below. You have to use the following format : @[domaine_name].[domaine_extension] - Example : @hotmail.com Seperate the different domains with a comma (,) ';
+$lang['audit'] = 'Audit';
+$lang['submit'] = 'Submit';
+
+
+/* ConfirmMail Configuration Tab */
+$lang['ConfirmMail_Title'] = 'Advanced management and settings of register confirmation by mail';
+$lang['Title_Tab2'] = 'UserAdvManager - ConfirmMail Settings';
+$lang['Tab_ConfirmMail'] = 'ConfirmMail Settings';
+$lang['UserAdvManager_ConfirmMail_Info'] = 'Time limitation for validation of registration : If you enable this option, select the desired time (x) )in the field below. Visitors who register will then have x days to validate their registration. After this period the validation link they have received by mail will be expired. ';
+$lang['UserAdvManager_ConfirmMail_TimeOut_true'] = 'Enable limiting the registration deadline.';
+$lang['UserAdvManager_ConfirmMail_TimeOut_false'] = 'Disable limiting the registration deadline.';
+$lang['UserAdvManager_ConfirmMail_TimeOut'] = 'Validation delay :';
+$lang['UserAdvManager_ConfirmMail_Delay_Info'] = 'Enter the number of days before expiry of the registration validation : ';
+/* This function can't work due to no access to server's cron functionnalities */
+//$lang['UserAdvManager_ConfirmMail_AutoDel'] = 'Suppression automatique des comptes non validés après le délai d\'expiration : ';
+//$lang['UserAdvManager_ConfirmMail_AutoDel_true'] = 'Activer la suppression automatique - ATTENTION ! La suppression est aveugle et sans notification.';
+//$lang['UserAdvManager_ConfirmMail_AutoDel_false'] = 'Désactiver la suppression automatique.';
+$lang['UserAdvManager_ConfirmMail_Remail'] = 'Enable or disable email reminder of unvalidated registers :';
+$lang['UserAdvManager_ConfirmMail_Remail_true'] = 'Enable email reminder';
+$lang['UserAdvManager_ConfirmMail_Remail_false'] = 'Disable email reminder';
+$lang['UserAdvManager_ConfirmMail_ReMail_Txt1'] = 'Custom content of the recall message with regeneration of validation key. If left blank, the recall mail will include only the validation link. It is therefore strongly advised to take a little explanatory text. (NB: The text pre-filled with the installation of the plugin is given as an example)
(!!! WARNING ! Text modification is available ONLY if email reminder is enabled. Use the multi language tags from Extended Description plugin if this plugin is activated !!!)';
+$lang['UserAdvManager_ConfirmMail_ReMail_Txt2'] = 'Custom content of the recall message without regeneration of validation key. If left blank, the recall mail will include only the validation link. It is therefore strongly advised to take a little explanatory text. (NB: The text pre-filled with the installation of the plugin is given as an example)
(!!! WARNING ! Text modification is available ONLY if email reminder is enabled. Use the multi language tags from Extended Description plugin if this plugin is activated !!!)';
+
+
+/* UserManager Tab */
+$lang['UserManager_Title'] = 'Advanced settings of unvalidated registered users';
+$lang['Title_Tab3'] = 'UserAdvManager - Visitors management';
+$lang['Tab_UserManager'] = 'Visitors management';
+$lang['UserAdvManager_ConfirmMail_User_List'] = 'When limiting the deadline for registration is enabled, you will find below the list of users awaiting validation, whether or not they are in time to validate.
In this view, you can:
+
+- Manually delete accounts (manual drain)
+
+- Generate email reminder without generating a new key. Warning: Send an email reminder to targeted visitors. This function does not reset the date of registration of targeted visitors and the timeout is still valid.
+
+- Generate email reminder with generating a new key. Warning : Send an email reminder to targeted visitors. This function also resets the date of registration of targeted visitors which equates to extend the deadline for validation.
+- Submit a registration awaiting validation manually even if the expiry date has passed (forcing validation).
+ ';
+$lang['Registration'] = 'Registration date';
+
+
+/* Mailing */
+$lang['infos_mail %s'] = '%s, please find here your information to login the gallery :';
+$lang['Password: %s'] = 'Password: %s';
+$lang['Add of %s'] = 'Add of %s';
+$lang['Update of %s'] = 'Update of %s';
+$lang['Link: %s'] = 'Please, click on this link to confirm your regsitration : %s';
+$lang['Reminder_with_key_of_%s'] = '%s, your validation key has been renewed';
+$lang['Reminder_without_key_of_%s'] = '%s, your validation key will expire';
+
+
+/* Email confirmation page */
+$lang['title_confirm_mail'] = 'Validate your registration';
+$lang['confirm_mail_page_title'] = 'Validate your registration';
+$lang['confirm_mail_ok'] = '
Thank you to have confirmed your email address and your registration on the gallery. Have fun !
';
+$lang['confirm_mail_bad'] = '
Your activation key is incorrect or expired or you have already validated your account, please contact the webmaster to fix this problem.
';
+
+
+/* Errors and Warnings */
+$lang['UserAdvManager_audit_ok'] = 'Audit OK';
+$lang['UserAdvManager_save_config'] ='Configuration saved.';
+$lang['Err_audit_no_casse'] = 'These accounts are identical to the case closely : ';
+$lang['Err_audit_username_char'] = 'This account uses one or more forbidden characters : ';
+$lang['Err_audit_email_forbidden'] = 'This account uses a forbidden email provider : ';
+$lang['Err_audit_advise'] = 'you have to perform corrections to comply with new rules that you have activated. Use a database management utility to correct user accounts directly in the table ### _USERS';
+$lang['UserAdvManager_Empty Author'] = 'The author field have to be filled to send a comment.';
+if ( isset($conf_UserAdvManager[1]) and $conf_UserAdvManager[1] == 'true' )
+ $lang['reg_err_login5'] = 'Username already exist, WARNING name is case insensitive (Shift = Tiny).';
+$lang['reg_err_login6'] = 'Username does not match the following characters: ';
+$lang['reg_err_login7'] = 'Your email provider is banned for registration. Banned email providers are: ';
+$lang['UserAdvManager_empty_pwd'] = '[empty password]';
+$lang['UserAdvManager_no_update_pwd'] = '[profile updated without password changed]';
+$lang['invalid_pwd'] = 'Invalid username or password !';
+$lang['Err_ConfirmMail_Settings'] = 'This page will be available only if "Email address confirmation" is activated in tab "Global Configuration".';
+$lang['Err_UserManager_Settings'] = 'This page is available only if "Enable limiting the registration deadline" is active in the "ConfirmMail Settings" tab.';
+$lang['No_validation_for_Guest'] = 'The "Guest" account is not subject to validation';
+$lang['No_validation_for_default_user'] = 'The default account is not subject to validation';
+$lang['No_validation_for_Webmaster'] = 'The "Webmaster" account is not subject to validation';
+$lang['No_validation_for_your_account'] = 'You personnal admin account is not subject to validation';
+$lang['Database_Error'] = 'Warning! Critical integrity error in your database.
Please check the integrity of the #_user_confirm_mail table.';
+
+
+/* Processing messages */
+$lang['%d_Mail_With_Key'] = '%d message with key renewal was sent';
+$lang['%d_Mails_With_Key'] = '%d messages with key renewal were sent';
+$lang['%d_Reminder_Sent'] = '%d reminder message was sent';
+$lang['%d_Reminders_Sent'] = '%d reminder messages were sent';
+$lang['%d_Validated_User'] = '%d User validated manually';
+$lang['%d_Validated_Users'] = '%d Users validated manually';
+
+
+/* Action button names */
+$lang['Delete_selected'] = 'Delete';
+$lang['Mail_without_key'] = 'Reminder without key';
+$lang['Mail_with_key'] = 'Reminder with key';
+$lang['Force_Validation'] = 'Forced validation';
+?>
Index: /extensions/NBC_UserAdvManager/tags/2.11.1/language/fr_FR/index.php
===================================================================
--- /extensions/NBC_UserAdvManager/tags/2.11.1/language/fr_FR/index.php (revision 3875)
+++ /extensions/NBC_UserAdvManager/tags/2.11.1/language/fr_FR/index.php (revision 3875)
@@ -0,0 +1,33 @@
+
Index: /extensions/NBC_UserAdvManager/tags/2.11.1/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/NBC_UserAdvManager/tags/2.11.1/language/fr_FR/plugin.lang.php (revision 3875)
+++ /extensions/NBC_UserAdvManager/tags/2.11.1/language/fr_FR/plugin.lang.php (revision 3875)
@@ -0,0 +1,132 @@
+(!!! ATTENTION ! Utilisez la méthode multi language du plugin Extended Description si celui-ci est activé !!!)';
+$lang['UserAdvManager_No_Casse'] = 'Utilisateur insensible à la casse';
+$lang['UserAdvManager_No_Casse_true'] = ' Rendre le compte utilisateur insensible à la casse, lors de l\'inscription et l\identification.';
+$lang['UserAdvManager_No_Casse_false'] = ' Laisser les utilisateur sensible à la casse.';
+$lang['UserAdvManager_Username_Char'] = 'Caractères limités pour le nom d\'utilisateur';
+$lang['UserAdvManager_Username_Char_true'] = ' Interdire les caractères saisis dans le champs ci-après pour le nom d\'utilisateur lors de l\'inscription == ';
+$lang['UserAdvManager_Username_Char_false'] = ' Laisser le contrôle par défaut du nom d\'utilisateur.';
+$lang['UserAdvManager_Confirm_Mail'] = 'Confirmation de l\'adresse email';
+$lang['UserAdvManager_Confirm_Mail_true'] = ' Envoyer un mail permettant a l\'utilisateur de confirmer son adresse email et donc son compte utilisateur.';
+$lang['UserAdvManager_Confirm_Mail_false'] = ' Système d\'inscription et de mise à jour standard sans confirmation de l\'adresse email.';
+$lang['UserAdvManager_ConfirmMail_Text'] = 'Texte utilisé pour l\'introduction du mail envoyé à l\'utilisateur pour confirmer son adresse mail (!!! ATTENTION ! Utilisez la méthode multi language du plugin Extended Description si celui-ci est activé !!!)';
+$lang['UserAdvManager_No_Confirm_Group'] = 'Groupe à utiliser pour les utilisateurs qui n\'ont pas encore confirmé leur adresse email';
+$lang['UserAdvManager_Validated_Group'] = 'Groupe à utiliser pour les utilisateurs qui ont validé leur adresse email';
+$lang['UserAdvManager_No_Confirm_Status'] = 'Status utilisateur à utiliser pour les utilisateurs qui n\'ont pas encore confirmé leur adresse email';
+$lang['UserAdvManager_Validated_Status'] = 'Status utilisateur à utiliser pour les utilisateurs qui ont validé leur adresse email, laissez ------- pour garder la valuer par défaut de PWG';
+$lang['UserAdvManager_No_Comment_Anonymous'] = 'Pseudo obligatoire sur commentaire';
+$lang['UserAdvManager_No_Comment_Anonymous_true'] = ' Le champs auteur doit être renseigné pour enregistrer un commentaire.';
+$lang['UserAdvManager_No_Comment_Anonymous_false'] = ' Laisser le fonctionnement par défaut pour enregistrer un commentaire.';
+$lang['UserAdvManager_MailExclusion'] = 'Exclusion des domaines de messagerie';
+$lang['UserAdvManager_MailExclusion_true'] = ' Activer l\'exclusion des domaines de messagerie (par exemple @hotmail.* ou @msn.*)';
+$lang['UserAdvManager_MailExclusion_false'] = ' Désactiver l\'exclusion des domaines de messagerie.';
+$lang['UserAdvManager_MailExclusion_List'] = ' Si l\'exclusion de domaines de messagerie est activée, saisissez les domaines à exclure ici. Il faut respecter le format suivant : @[nom_du_domaine].[extension_du_domaine] - Exemple : @hotmail.com
Séparez les domaines par une virgule ';
+$lang['audit'] = 'Audit';
+$lang['submit'] = 'Valider';
+
+
+/* ConfirmMail Configuration Tab */
+$lang['ConfirmMail_Title'] = 'Configuration et gestion avancée de la confirmation par mail';
+$lang['Title_Tab2'] = 'UserAdvManager - Configuration de ConfirmMail';
+$lang['Tab_ConfirmMail'] = 'Configuration de ConfirmMail';
+$lang['UserAdvManager_ConfirmMail_Info'] = 'Limitation du délai de validation de l\'inscription : Si vous activez cette option, sélectionnez le délai (x) )souhaité dans la liste qui suit. Les visiteurs qui s\'inscriront alors auront x jours de délais pour valider leur inscription. Passé ce délai, le lien de validation qu\'ils auront reçu par mail sera expiré. ';
+$lang['UserAdvManager_ConfirmMail_TimeOut_true'] = 'Activer la limitation du délai d\'inscription.';
+$lang['UserAdvManager_ConfirmMail_TimeOut_false'] = 'Désactiver la limitation du délai d\'inscription.';
+$lang['UserAdvManager_ConfirmMail_TimeOut'] = 'Délai d\activation :';
+$lang['UserAdvManager_ConfirmMail_Delay_Info'] = 'Saisissez ici le nombre de jours avant expiration de la validation d\'inscription : ';
+/* This function can't work due to no access to server's cron functionnalities */
+//$lang['UserAdvManager_ConfirmMail_AutoDel'] = 'Suppression automatique des comptes non validés après le délai d\'expiration : ';
+//$lang['UserAdvManager_ConfirmMail_AutoDel_true'] = 'Activer la suppression automatique - ATTENTION ! La suppression est aveugle et sans notification.';
+//$lang['UserAdvManager_ConfirmMail_AutoDel_false'] = 'Désactiver la suppression automatique.';
+$lang['UserAdvManager_ConfirmMail_Remail'] = 'Activer ou désactiver la fonctionnalité de rappel des inscrits non validés : ';
+$lang['UserAdvManager_ConfirmMail_Remail_true'] = 'Activer le rappel par mail';
+$lang['UserAdvManager_ConfirmMail_Remail_false'] = 'Désactiver le rappel par mail';
+$lang['UserAdvManager_ConfirmMail_ReMail_Txt1'] = 'Contenu personnalisé du message de rappel avec regénération de clé de validation. Si laissé vide, le mail de rappel ne comportera que le lien de validation. Il est donc vivement conseillé de saisir un petit texte explicatif. (NB : Le texte pré renseigné à l\'installation du plugin est donné en exemple)
(!!! ATTENTION ! La modification du texte n\'est possible QUE si le rappel par email est activé. Utilisez la méthode multi language du plugin Extended Description si celui-ci est activé !!!)';
+$lang['UserAdvManager_ConfirmMail_ReMail_Txt2'] = 'Contenu personnalisé du message de rappel sans regénération de clé de validation. Si laissé vide, le mail de rappel sera vide. Il est donc vivement conseillé de saisir un petit texte explicatif. (NB : Le texte pré renseigné à l\'installation du plugin est donné en exemple)
(!!! ATTENTION ! La modification du texte n\'est possible QUE si le rappel par email est activé. Utilisez la méthode multi language du plugin Extended Description si celui-ci est activé !!!)';
+
+
+/* UserManager Tab */
+$lang['UserManager_Title'] = 'Gestion avancée des inscrits non validés';
+$lang['Title_Tab3'] = 'UserAdvManager - Gestion des visiteurs';
+$lang['Tab_UserManager'] = 'Gestion des visiteurs';
+$lang['UserAdvManager_ConfirmMail_User_List'] = 'Lorsque la limitation du délai d\'inscription est activée, vous trouverez ci-dessous la liste des utilisateurs en attente de validation d\'inscription qu\'ils soient ou pas dans les délais pour la valider.
Dans cette vue, vous pouvez :
+
+- Supprimer manuellement les comptes (purge manuelle)
+
+- Générer l\'email de rappel sans génération d\'une nouvelle clef. Rappel : Cette fonction ne réinitialise pas la date d\'inscription du visiteur ciblé et le délai d\'expiration est toujours d\'actualité.
+
+- Générer l\'email de rappel avec génération d\'une nouvelle clef. Rappel : Cette fonction réinitialise également la date d\'inscription du visiteur ciblé ce qui équivaut à prolonger le délai de validation.
+- Valider manuellement une inscription en attente de validation même si la date d\'expiration est révolue (forçage de la validation).
+ ';
+$lang['Registration'] = 'Date d\'enregistrement';
+
+
+/* Mailing */
+$lang['infos_mail %s'] = '%s, voici vos informations pour vous identifier sur la galerie :';
+$lang['Password: %s'] = 'Mot de passe: %s';
+$lang['Add of %s'] = 'Création de %s';
+$lang['Update of %s'] = 'Mise à jour de %s';
+$lang['Link: %s'] = 'Cliquez sur le lien suivant pour confirmer votre inscription : %s';
+$lang['Reminder_with_key_of_%s'] = '%s, votre clé de confirmation a été renouvelée';
+$lang['Reminder_without_key_of_%s'] = '%s, votre clé de confirmation va expirer';
+
+
+/* Email confirmation page */
+$lang['title_confirm_mail'] = 'Confirmation de votre inscription';
+$lang['confirm_mail_page_title'] = 'Confirmation d\'inscription';
+$lang['confirm_mail_ok'] = '
Merci d\'avoir confirmé votre mail et aussi et surtout votre inscription sur le site, profitez bien des photos ...
';
+$lang['confirm_mail_bad'] = '
Votre clef d\'activation unique est érronée ou expirée ou vous avez déjà validé votre compte, veuillez contacter le webmaster pour régler ce problème.
';
+
+
+/* Errors and Warnings */
+$lang['UserAdvManager_audit_ok'] = 'Audit OK';
+$lang['UserAdvManager_save_config'] ='Configuration enregistrée.';
+$lang['Err_audit_no_casse'] = 'Ces comptes sont identiques à la casse près : ';
+$lang['Err_audit_username_char'] = 'Ce compte contient un ou des caractères interdits : ';
+$lang['Err_audit_email_forbidden'] = 'Ce compte contient des domaines de messagerie interdit : ';
+$lang['Err_audit_advise'] = 'Vous avez des corrections a faire pour respecter les nouvelles règles que vous avez activé utilisez un utilitaire de gestion de base de données pour corriger les comptes utilisateurs directement dans la table ###_USERS si nécessaire.';
+$lang['UserAdvManager_Empty Author'] = 'Le champs auteur doit être rempli pour enregistrer un commentaire.';
+if ( isset($conf_UserAdvManager[1]) and $conf_UserAdvManager[1] == 'true' )
+ $lang['new_reg_err_login5'] = 'ce nom utilisateur est déjà pris, ATTENTION le nom est insensible à la casse (Majuscule = Minuscule).';
+$lang['reg_err_login6'] = 'le nom utilisateur ne doit pas contenir les caractère suivants : ';
+$lang['reg_err_login7'] = 'L\'adresse email est issue d\'un prestataire interdit. Les prestataires d\'adresses email interdits à l\'inscription sont : ';
+$lang['UserAdvManager_empty_pwd'] = '[mot de passe vide]';
+$lang['UserAdvManager_no_update_pwd'] = '[mise à jour du profil sans changement du mot de passe]';
+$lang['invalid_pwd'] = 'Nom utilisateur ou Mot de passe invalide !';
+$lang['Err_ConfirmMail_Settings'] = 'Cette page n\'est accessible que si "Confirmation de l\'adresse email" est actif dans l\'onglet "Configuration Générale".';
+$lang['Err_UserManager_Settings'] = 'Cette page n\'est accessible que si "Délai de validation d\'inscription" est actif dans l\'onglet "Configuration de ConfirmMail".';
+$lang['No_validation_for_Guest'] = 'Le compte Guest n\'est pas soumis à validation';
+$lang['No_validation_for_default_user'] = 'Le compte par défaut n\'est pas soumis à validation';
+$lang['No_validation_for_Webmaster'] = 'Le compte du Webmaster n\'est pas soumis à validation';
+$lang['No_validation_for_your_account'] = 'Votre compte d\'admin n\'est pas soumis à validation';
+$lang['Database_Error'] = 'Attention ! Erreur critique d\'intégrité dans votre base de données.
Veuillez contrôler l\'intégrité de la table #_user_confirm_mail.';
+
+
+/* Processing messages */
+$lang['%d_Mail_With_Key'] = '%d message avec renouvellement de clé a été envoyé';
+$lang['%d_Mails_With_Key'] = '%d messages avec renouvellement de clé ont été envoyés';
+$lang['%d_Reminder_Sent'] = '%d message de rappel a été envoyé';
+$lang['%d_Reminders_Sent'] = '%d messages de rappel ont été envoyés';
+$lang['%d_Validated_User'] = '%d Utilisateur validé manuellement';
+$lang['%d_Validated_Users'] = '%d Utilisateurs validés manuellement';
+
+
+/* Action button names */
+$lang['Delete_selected'] = 'Supprimer';
+$lang['Mail_without_key'] = 'rappel sans clé';
+$lang['Mail_with_key'] = 'rappel avec clé';
+$lang['Force_Validation'] = 'Validation forcée';
+?>
Index: /extensions/NBC_UserAdvManager/tags/2.11.1/language/index.php
===================================================================
--- /extensions/NBC_UserAdvManager/tags/2.11.1/language/index.php (revision 3875)
+++ /extensions/NBC_UserAdvManager/tags/2.11.1/language/index.php (revision 3875)
@@ -0,0 +1,33 @@
+
Index: /extensions/NBC_UserAdvManager/tags/2.11.1/main.inc.php
===================================================================
--- /extensions/NBC_UserAdvManager/tags/2.11.1/main.inc.php (revision 3875)
+++ /extensions/NBC_UserAdvManager/tags/2.11.1/main.inc.php (revision 3875)
@@ -0,0 +1,407 @@
+ Known bug : This feature doesn't work on user profile page. So, already registered users can change their email address to a forbiden one.
+
+-- 2.10.9a : Email provider exclusion is no longer case sensitive
+
+-- 2.10.9b : Bug fixed - Home icon wasn't linked to gallery url in ConfirmMail page. If GALLERY_URL is not set, Home icon gets the pwg root path.
+
+-- 2.10.9c : Bug fixed - If Email provider exclusion is set off, new registered user will have a PHP notice on "Undefined variable: ncsemail"
+
+-- 2.10.9d : Code simplification - need no more ""template"" sub-directory in plugin directory for enhance "back link" icon in ConfirMail.tpl
+
+-- 2.10.9e : Compatibility improvement with PHP 5.3 - Some old functions will be deprecated like :
+ ereg replaced by preg_match
+ eregi replace by preg_match with "i" moderator
+ split replace by preg_split
+
+-- 2.10.9f : Compatibility bug fixed when used with DynamicRecentPeriod plugin
+
+-- 2.11.0 : New tabsheet menu to manage ConfirMail functions (setting a timeout without validation, Cleanup expired user's accounts, Force confirmation, Renew validation key, list unvalidated users,...)
+ Beautify plugin's main admin panel
+
+-- 2.11.1 : Bug fixed with install and upgrade functions
+ Language files correction
+
+*/
+
+/*
+
+ ***** TODO List *****
+
+++ No validation needed for admins users comments (new trigger needed in comments.php)
+
+++ No single email check for admins (new trigger needed in (functions_user.inc.php ?))
+
+++ Password control and enforcement
+ -- Empty password (done in Piwigo 2.x)
+ ++ Can not be the same as username
+ ++ complexity of the password (Numbers+Lettrers+Low and high case+Special+minimal length)
+
+++ Security : Blocking brut-force attacks !
+
+++ Opportunity to copy a registered user for new user creation
+ ++ new copied user will (or not) belong to the same groups
+ ++ new copied user will (or not) get the same status (visitor, admin, webmaster, guest (??))
+ ++ new copied user will (or not) get the same properties
+ ++ new copied user will (or not) get the same language
+ ... and so on
+
+*/
+
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+define('NBC_UserAdvManager_DIR' , basename(dirname(__FILE__)));
+define('NBC_UserAdvManager_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/');
+
+include_once (NBC_UserAdvManager_PATH.'include/constants.php');
+include_once (NBC_UserAdvManager_PATH.'include/functions_UserAdvManager.inc.php');
+
+load_language('plugin.lang', NBC_UserAdvManager_PATH);
+
+
+/* Plugin admin */
+add_event_handler('get_admin_plugin_menu_links', 'nbc_UserAdvManager_admin_menu');
+
+function nbc_UserAdvManager_admin_menu($menu)
+{
+ array_push($menu,
+ array(
+ 'NAME' => 'UserAdvManager',
+ 'URL' => get_admin_plugin_menu_link(NBC_UserAdvManager_PATH.'/admin/UserAdvManager_admin.php')
+ )
+ );
+
+ return $menu;
+}
+
+
+
+/* User creation */
+add_event_handler('register_user', 'UserAdvManager_Adduser');
+
+function UserAdvManager_Adduser($register_user)
+{
+ global $conf;
+
+ $conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array();
+
+ if (( isset($conf_nbc_UserAdvManager[0]) and $conf_nbc_UserAdvManager[0] == 'true') or ( isset($conf_nbc_UserAdvManager[2]) and $conf_nbc_UserAdvManager[2] == 'true'))
+
+ SendMail2User(1, $register_user['id'], $register_user['username'], $_POST['password'], $register_user['email'], true);
+}
+
+
+
+/* User deletion */
+add_event_handler('delete_user', 'UserAdvManager_Deluser');
+
+function UserAdvManager_Deluser($user_id)
+{
+
+ DeleteConfirmMail($user_id);
+
+}
+
+
+
+add_event_handler('init', 'UserAdvManager_InitPage');
+
+function UserAdvManager_InitPage()
+{
+ load_language('plugin.lang', NBC_UserAdvManager_PATH);
+ global $conf, $template, $page, $lang;
+
+ $conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array();
+
+
+ if ( isset($conf_nbc_UserAdvManager[1]) and $conf_nbc_UserAdvManager[1] == 'true' )
+ $lang['reg_err_login5'] = l10n('new_reg_err_login5');
+
+
+
+/* User identification */
+ if (script_basename() == 'identification')
+ {
+ if (isset($_POST['login']))
+ {
+ /* User non case sensitive */
+ if (isset($conf_nbc_UserAdvManager[1]) and $conf_nbc_UserAdvManager[1] == 'true' )
+ {
+ $new_username = NotSensibleSearchUsername($_POST['username']);
+ $_POST['username'] = $new_username == '' ? $_POST['username'] : $new_username;
+ }
+ }
+ }
+
+
+
+/* Admin user management */
+ if (script_basename() == 'admin' and isset($_GET['page']) and $_GET['page'] == 'user_list')
+ {
+ if (isset($_POST['submit_add']))
+ {
+ /* User non case sensitive */
+ if (isset($conf_nbc_UserAdvManager[1]) and $conf_nbc_UserAdvManager[1] == 'true' )
+ {
+ $new_username = NotSensibleSearchUsername($_POST['login']);
+ $_POST['login'] = $new_username == '' ? $_POST['login'] : $new_username;
+ }
+
+
+ /* Username without forbidden keys */
+ if (isset($conf_nbc_UserAdvManager[7]) and $conf_nbc_UserAdvManager[7] == 'true' and !empty($_POST['login']) and !ValidateUsername($_POST['login']))
+ {
+ $lang['reg_err_login1'] = l10n('reg_err_login6')."'".$conf_nbc_UserAdvManager[8]."'";
+ $_POST['login'] = '';
+ }
+
+ /* Email without forbidden domains */
+ /* This don't work on call of ValidateEmailProvider() function - Why ?? -> Due to the "return = false|true" in function ?*/
+ //if (isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' and !empty($_POST['email']) and !ValidateEmailProvider($_POST['email']))
+ //{
+ // $lang['reg_err_login1'] = l10n('reg_err_login7')."'".$conf_nbc_UserAdvManager[13]."'";
+ // $_POST['login'] = '';
+ //}
+ /* This work with a code copy of ValidateEmailProvider() function */
+ if (isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' and !empty($_POST['email']))
+ {
+ $ncsemail = strtolower($_POST['email']);
+ $conf_nbc_MailExclusion = preg_split('/,/',$conf_nbc_UserAdvManager[13]);
+ for ($i = 0 ; $i < count($conf_nbc_MailExclusion) ; $i++)
+ {
+ $pattern = '/'.$conf_nbc_MailExclusion[$i].'/';
+ if (preg_match($pattern, $ncsemail))
+ {
+ $lang['reg_err_login1'] = l10n('reg_err_login7')."'".$conf_nbc_UserAdvManager[13]."'";
+ $_POST['login'] = '';
+ }
+ }
+ }
+ }
+ }
+
+/* User creation */
+ if (script_basename() == 'register')
+ {
+ if (isset($_POST['submit']))
+ {
+ /* Username non case sensitive */
+ if (isset($conf_nbc_UserAdvManager[1]) and $conf_nbc_UserAdvManager[1] == 'true')
+ {
+ $new_username = NotSensibleSearchUsername($_POST['login']);
+ $_POST['login'] = $new_username == '' ? $_POST['login'] : $new_username;
+ }
+
+
+ /* Username without forbidden keys */
+ if (isset($conf_nbc_UserAdvManager[7]) and $conf_nbc_UserAdvManager[7] == 'true' and !empty($_POST['login']) and !ValidateUsername($_POST['login']))
+ {
+ $lang['reg_err_login1'] = l10n('reg_err_login6')."'".$conf_nbc_UserAdvManager[8]."'";
+ $_POST['login'] = '';
+ }
+
+
+ /* Email without forbidden domains */
+ /* This don't work on call of ValidateEmailProvider() function - Why ?? -> Due to the "return = false|true" in function ?*/
+ //if (isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' and !empty($_POST['mail_address']) and !ValidateEmailProvider($_POST['mail_address']))
+ //{
+ // $lang['reg_err_mail_address'] = l10n('reg_err_login7')."'".$conf_nbc_UserAdvManager[13]."'";
+ // $_POST['mail_address'] = '';
+ //}
+ /* This work with a code copy of ValidateEmailProvider() function */
+ if (isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' and !empty($_POST['mail_address']))
+ {
+ $ncsemail = strtolower($_POST['mail_address']);
+ $conf_nbc_MailExclusion = preg_split('/,/',$conf_nbc_UserAdvManager[13]);
+ for ($i = 0 ; $i < count($conf_nbc_MailExclusion) ; $i++)
+ {
+ $pattern = '/'.$conf_nbc_MailExclusion[$i].'/';
+ if (preg_match($pattern, $ncsemail))
+ {
+ $lang['reg_err_login1'] = l10n('reg_err_login7')."'".$conf_nbc_UserAdvManager[13]."'";
+ $_POST['login'] = '';
+ }
+ }
+ }
+ }
+ }
+
+/* User profile update */
+ if (script_basename() == 'profile')
+ {
+ if (isset($_POST['validate']))
+ {
+ /* Sending email to user */
+ if (( isset($conf_nbc_UserAdvManager[0]) and $conf_nbc_UserAdvManager[0] == 'true') or ( isset($conf_nbc_UserAdvManager[2]) and $conf_nbc_UserAdvManager[2] == 'true'))
+ {
+ global $conf, $user ;
+ $errors = array();
+
+ $int_pattern = '/^\d+$/';
+ if (empty($_POST['nb_image_line'])
+ or (!preg_match($int_pattern, $_POST['nb_image_line'])))
+ {
+ $errors[] = l10n('nb_image_line_error');
+ }
+
+ if (empty($_POST['nb_line_page'])
+ or (!preg_match($int_pattern, $_POST['nb_line_page'])))
+ {
+ $errors[] = l10n('nb_line_page_error');
+ }
+
+ if ($_POST['maxwidth'] != ''
+ and (!preg_match($int_pattern, $_POST['maxwidth'])
+ or $_POST['maxwidth'] < 50))
+ {
+ $errors[] = l10n('maxwidth_error');
+ }
+ if ($_POST['maxheight']
+ and (!preg_match($int_pattern, $_POST['maxheight'])
+ or $_POST['maxheight'] < 50))
+ {
+ $errors[] = l10n('maxheight_error');
+ }
+
+ if (isset($_POST['mail_address']))
+ {
+ $mail_error = validate_mail_address($user['id'], $_POST['mail_address']);
+ if (!empty($mail_error))
+ {
+ $errors[] = $mail_error;
+ }
+
+ if (isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' and !empty($_POST['mail_address']))
+ {
+ $ncsemail = strtolower($_POST['mail_address']);
+ $conf_nbc_MailExclusion = preg_split('/,/',$conf_nbc_UserAdvManager[13]);
+ for ($i = 0 ; $i < count($conf_nbc_MailExclusion) ; $i++)
+ {
+ $pattern = '/'.$conf_nbc_MailExclusion[$i].'/';
+ if (preg_match($pattern, $ncsemail))
+ {
+ $mail_error = l10n('reg_err_login7')."'".$conf_nbc_UserAdvManager[13]."'";
+ }
+ }
+ }
+ if (!empty($mail_error))
+ {
+ $errors[] = $mail_error;
+ }
+ }
+
+ $typemail = 3;
+
+ if (!empty($_POST['use_new_pwd']))
+ {
+ $typemail = 2;
+
+ // password must be the same as its confirmation
+ if ($_POST['use_new_pwd'] != $_POST['passwordConf'])
+ {
+ $errors[] = l10n('New password confirmation does not correspond');
+ }
+
+ if ( !defined('IN_ADMIN') )
+ {// changing password requires old password
+ $query = '
+ SELECT '.$conf['user_fields']['password'].' AS password
+ FROM '.USERS_TABLE.'
+ WHERE '.$conf['user_fields']['id'].' = \''.$user['id'].'\'
+ ;';
+ list($current_password) = mysql_fetch_row(pwg_query($query));
+
+ if ($conf['pass_convert']($_POST['password']) != $current_password)
+ {
+ $errors[] = l10n('Current password is wrong');
+ }
+ }
+ }
+
+ $confirm_mail_need = false;
+
+ if (!empty($_POST['mail_address']))
+ {
+ $query = '
+ SELECT '.$conf['user_fields']['email'].' AS email
+ FROM '.USERS_TABLE.'
+ WHERE '.$conf['user_fields']['id'].' = \''.$user['id'].'\'
+ ;';
+ list($current_email) = mysql_fetch_row(pwg_query($query));
+
+ if ( $_POST['mail_address'] != $current_email and ( isset($conf_nbc_UserAdvManager[2]) and $conf_nbc_UserAdvManager[2] == 'true') )
+ $confirm_mail_need = true;
+ }
+
+ if (count($errors) == 0 and (!empty($_POST['use_new_pwd']) and ( isset($conf_nbc_UserAdvManager[0]) and $conf_nbc_UserAdvManager[0] == 'true') or $confirm_mail_need) )
+ {
+ $query = '
+ SELECT '.$conf['user_fields']['username'].'
+ FROM '.USERS_TABLE.'
+ WHERE '.$conf['user_fields']['id'].' = \''.$user['id'].'\'
+ ;';
+ list($username) = mysql_fetch_row(pwg_query($query));
+
+
+ SendMail2User($typemail, $user['id'], $username, $_POST['use_new_pwd'], $_POST['mail_address'], $confirm_mail_need);
+ }
+ }
+ }
+ }
+}
+
+add_event_handler('user_comment_check', 'UserAdvManager_CheckEmptyCommentAuthor', 50, 2);
+
+function UserAdvManager_CheckEmptyCommentAuthor($comment_action, $comm)
+{
+ load_language('plugin.lang', NBC_UserAdvManager_PATH);
+ global $infos, $conf, $template;
+
+ $conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array();
+
+/* User creation OR update */
+ if (isset($conf_nbc_UserAdvManager[6]) and $conf_nbc_UserAdvManager[6] == 'true' and $conf['comments_forall'] == 'true' and $comm['author'] == 'guest')
+ {
+ $comment_action = 'reject';
+
+ array_push($infos, l10n('UserAdvManager_Empty Author'));
+ }
+
+ return $comment_action;
+}
+
+?>
Index: /extensions/NBC_UserAdvManager/tags/2.11.1/maintain.inc.php
===================================================================
--- /extensions/NBC_UserAdvManager/tags/2.11.1/maintain.inc.php (revision 3875)
+++ /extensions/NBC_UserAdvManager/tags/2.11.1/maintain.inc.php (revision 3875)
@@ -0,0 +1,117 @@
+