2 /************************************************************************
3 * Mailer v0.2.1-FINAL Start: 07/16/2004 *
4 * =================== Last change: 10/27/2004 *
6 * -------------------------------------------------------------------- *
7 * File : user_functions.php *
8 * -------------------------------------------------------------------- *
9 * Short description : Special functions for user extension *
10 * -------------------------------------------------------------------- *
11 * Kurzbeschreibung : Spezielle Funktionen fuer die user-Erweiterung *
12 * -------------------------------------------------------------------- *
15 * $Tag:: 0.2.1-FINAL $ *
17 * -------------------------------------------------------------------- *
18 * Copyright (c) 2003 - 2009 by Roland Haeder *
19 * Copyright (c) 2009 - 2011 by Mailer Developer Team *
20 * For more information visit: http://www.mxchange.org *
22 * This program is free software; you can redistribute it and/or modify *
23 * it under the terms of the GNU General Public License as published by *
24 * the Free Software Foundation; either version 2 of the License, or *
25 * (at your option) any later version. *
27 * This program is distributed in the hope that it will be useful, *
28 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
29 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
30 * GNU General Public License for more details. *
32 * You should have received a copy of the GNU General Public License *
33 * along with this program; if not, write to the Free Software *
34 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
36 ************************************************************************/
38 // Some security stuff...
39 if (!defined('__SECURITY')) {
43 // Add links for selecting some users
44 function alpha ($sortby, $colspan, $return=false) {
45 if (!isGetRequestParameterSet('offset')) setGetRequestParameter('offset', 0);
46 $add = '&page=' . getRequestParameter('page').'&offset=' . getRequestParameter('offset');
47 if (isGetRequestParameterSet('mode')) $add .= '&mode=' . getRequestParameter('mode');
49 /* Creates the list of letters and makes them a link. */
50 $alphabet = explode(',', 'A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,');
51 $num = count($alphabet) - 1;
53 while (list($counter, $ltr) = each($alphabet)) {
54 if (getRequestParameter('letter') == $ltr) {
55 // Current letter is letter from URL
56 $OUT .= '<strong>' . $ltr . '</strong>';
58 // Output link to letter
59 $OUT .= '<a href="{%url=modules.php?module=admin&what=' . getWhat();
60 if (isGetRequestParameterSet('mode')) $OUT .= '&mode=' . getRequestParameter('mode');
61 $OUT .= '&letter=' . $ltr . '&sortby=' . $sortby . $add . '%}">' . $ltr . '</a>';
64 if ((($counter / getConfig('user_alpha')) == round($counter / getConfig('user_alpha'))) && ($counter > 0)) {
66 } elseif ( $counter != $num ) {
73 'colspan2' => $colspan,
74 'alpha_selection' => $OUT
78 $OUT = loadTemplate('admin_list_user_alpha', true, $content);
79 if ($return === true) {
80 // Return generated code
83 // Output generated code
88 // Add links for sorting
89 function addSortLinks ($letter, $sortby, $colspan, $return=false) {
91 if (!isGetRequestParameterSet('offset')) setGetRequestParameter('offset', 0);
92 if (!isGetRequestParameterSet('page')) setGetRequestParameter('page' , 0);
94 // Add page and offset
95 $add = '&page=' . getRequestParameter('page') . '&offset=' . getRequestParameter('offset');
98 if (isGetRequestParameterSet('status')) $add .= '&mode=' . getRequestParameter('status');
99 elseif (isGetRequestParameterSet('mode')) $add .= '&mode=' . getRequestParameter('mode');
101 // Makes order by links..
102 if ($letter == 'front') {
106 // Prepare array with all possible sorters
108 'userid' => '{--_USERID--}',
109 'family' => '{--FAMILY--}',
110 'email' => '{--EMAIL--}',
111 'REMOTE_ADDR' => '{--REMOTE_IP--}'
114 // Add nickname if extension is installed
115 if (isExtensionActive('nickname')) {
116 $list['nickname'] = '{--NICKNAME--}';
119 foreach ($list as $sort => $title) {
120 if ($sortby == $sort) {
121 $OUT .= '<strong>' . $title . '</strong>|';
123 $OUT .= '<a href="{%url=modules.php?module=admin&what=list_user&letter=' . $letter . '&sortby=' . $sort . $add . '%}">' . $title . '</a>|';
127 // Add list and colspan
128 $content['list'] = substr($OUT, 0, -1);
129 $content['colspan2'] = $colspan;
132 $OUT = loadTemplate('admin_list_user_sort', true, $content);
134 // Should we return or output?
135 if ($return === true) {
144 // Add page navigation
145 function addPageNavigation ($numPages, $offset, $showForm, $colspan, $return=false) {
146 // @TODO These two constants are no longer used, maybe we reactivate this code?
147 //if ($showForm === true) {
148 // // Load form for changing number of lines
149 // define('__FORM_HEADER', loadTemplate('admin_list_user_sort_form', true));
150 // define('__FORM_FOOTER', '<tr><td colspan="'.$colspan.'" class="seperator bottom"> </td></tr>');
153 // define('__FORM_HEADER', '<tr><td colspan="' . $colspan . '" class="seperator"> </td></tr>');
154 // define('__FORM_FOOTER', '<tr><td colspan="' . $colspan . '" class="seperator bottom"> </td></tr>');
158 for ($page = 1; $page <= $numPages; $page++) {
159 if (($page == getRequestParameter('page')) || ((!isGetRequestParameterSet('page')) && ($page == 1))) {
162 if (!isGetRequestParameterSet('letter')) setGetRequestParameter('letter', '');
163 if (!isGetRequestParameterSet('sortby')) setGetRequestParameter('sortby', 'userid');
166 $OUT .= '<a href="{%url=modules.php?module=admin&what=' . getWhat();
168 // Add status or mode
169 if (isGetRequestParameterSet('status')) $OUT .= '&mode=' . getRequestParameter('status');
170 elseif (isGetRequestParameterSet('mode')) $OUT .= '&mode=' . getRequestParameter('mode');
173 $OUT .= '&letter=' . getRequestParameter('letter') . '&sortby=' . getRequestParameter('sortby') . '&page=' . $page . '&offset=' . $offset . '%}">';
178 if (($page == getRequestParameter('page')) || ((!isGetRequestParameterSet('page')) && ($page == 1))) {
179 $OUT .= '-</strong>';
184 if ($page < $numPages) $OUT .= '|';
187 // Remember the list and colspan
188 $content['list'] = $OUT;
189 $content['colspan2'] = $colspan;
192 $OUT = loadTemplate('admin_list_user_pagenav', true, $content);
193 if ($return === true) {
202 // Create email link to user's account
203 function generateUserEmailLink ($email, $mod = 'admin') {
204 // Show contact link only if user is confirmed by default
205 $locked = " AND `status`='CONFIRMED'";
207 // But admins shall always see it
208 if (isAdmin()) $locked = '';
210 $result = SQL_QUERY_ESC("SELECT
213 `{?_MYSQL_PREFIX?}_user_data`
215 `email`='%s'" . $locked."
217 array($email), __FUNCTION__, __LINE__);
218 if (SQL_NUMROWS($result) == 1) {
220 list($userid) = SQL_FETCHROW($result);
222 // Rewrite email address to contact link
223 $email = '{%url=modules.php?module=' . $mod . '&what=user_contct&userid=' . bigintval($userid) . '%}';
227 SQL_FREERESULT($result);
229 // Return rewritten (?) email address
233 // Selects a random user id as the new referal id if they have at least X confirmed mails in this run
234 // @TODO Double-check configuration entry here
235 function determineRandomReferalId () {
236 // Default is zero refid
239 // Is the extension version fine?
240 if (isExtensionInstalledAndNewer('user', '0.3.4')) {
242 $totalUsers = countSumTotalData('CONFIRMED', 'user_data', 'userid', 'status', true, " AND `rand_confirmed` >= {?user_min_confirmed?}");
244 // Do we have at least one?
245 if ($totalUsers > 0) {
246 // Then choose random number
247 $randNum = mt_rand(0, ($totalUsers - 1));
249 // Look for random user
250 $result = SQL_QUERY_ESC("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `status`='CONFIRMED' AND `rand_confirmed` >= {?user_min_confirmed?} ORDER BY `rand_confirmed` DESC LIMIT %s, 1",
251 array($randNum), __FUNCTION__, __LINE__);
253 // Do we have one entry there?
254 if (SQL_NUMROWS($result) == 1) {
255 // Use that userid as new referal id
256 list($refid) = SQL_FETCHROW($result);
258 // Reset all users, this makes this random referal id more challenging
259 SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `rand_confirmed`=0",
260 array($refid), __FUNCTION__, __LINE__);
264 SQL_FREERESULT($result);
273 function doUserLogin ($userid, $passwd, $successUrl = '', $errorUrl = 'modules.php?module=index&what=login&login=') {
291 if ((isExtensionActive('nickname')) && (isNicknameUsed($userid))) {
293 fetchUserData($userid, 'nickname');
294 } elseif (isNicknameUsed($userid)) {
295 // No nickname installed
296 $errorCode = getCode('EXTENSION_PROBLEM');
299 // Direct userid entered
300 $isFound = fetchUserData($userid);
304 if (($errorCode == '0') && ($isFound === true)) {
305 // Get user data array and set userid (e.g. important if we login with nickname)
306 $content = getUserDataArray();
307 if (!empty($content['userid'])) {
308 $userid = bigintval($content['userid']);
312 // Is there an entry?
313 if (($errorCode == '0') && (isUserDataValid()) && (getUserData('status') == 'CONFIRMED') && (!empty($content['userid']))) {
314 // Check for old MD5 passwords
315 if ((strlen(getUserData('password')) == 32) && (md5($passwd) == getUserData('password'))) {
316 // Just set the hash to the password from DB... :)
317 $content['hash'] = getUserData('password');
319 // Hash password with improved way for comparsion
320 $content['hash'] = generateHash($passwd, substr(getUserData('password'), 0, -40));
323 // Does the password match the hash?
324 if ($content['hash'] == getUserData('password')) {
325 // New hashed password found so let's generate a new one
326 $content['hash'] = generateHash($passwd);
328 // ... and update database
329 // @TODO Make this filter working: $ADDON = runFilterChain('post_login_update', $content);
330 SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `password`='%s' WHERE `userid`=%s AND `status`='CONFIRMED' LIMIT 1",
331 array($content['hash'], $userid), __FUNCTION__, __LINE__);
333 // No login bonus by default
334 $GLOBALS['bonus_payed'] = false;
336 // Is bonus up-to-date?
337 if (isExtensionInstalledAndNewer('bonus', '0.2.2')) {
338 // Probe for last online timemark
339 $probe = time() - getUserData('last_online');
340 if (getUserData('last_login') > 0) {
341 // Use timestamp from last login
342 $probe = time() - getUserData('last_login');
345 // Is the timeout reached?
346 if ($probe >= getConfig('login_timeout')) {
347 // Add login bonus to user's account
348 $add = ', `login_bonus`=`login_bonus`+{?login_bonus?}';
349 $GLOBALS['bonus_payed'] = true;
351 // Subtract login bonus from userid's account or jackpot
352 if ((isExtensionInstalledAndNewer('bonus', '0.3.5')) && (getBonusMode() != 'ADD')) {
353 handleBonusPoints('login_bonus');
358 // @TODO Make this filter working: $url = runFilterChain('do_login', array('content' => $content, 'addon' => $ADDON));
361 setMemberId($userid);
363 // Try to set session data (which shall normally always work!)
364 //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',hash=' . $content['hash'] . '(' . strlen($content['hash']) . ')');
365 if ((setSession('userid', $userid )) && (setSession('u_hash', encodeHashForCookie($content['hash'])))) {
366 // Update database records
367 SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `total_logins`=`total_logins`+1" . $add . " WHERE `userid`=%s LIMIT 1",
368 array($userid), __FUNCTION__, __LINE__);
369 if (!SQL_HASZEROAFFECTED()) {
370 // Is a success URL set?
371 if (empty($successUrl)) {
372 // Procedure to checking for login data
373 if (($GLOBALS['bonus_payed'] === true) && (isExtensionActive('bonus'))) {
374 // Bonus added (just displaying!)
375 $url = 'modules.php?module=chk_login&mode=bonus';
378 $url = 'modules.php?module=chk_login&mode=login';
385 // Cannot update counter!
386 $errorCode = getCode('CNTR_FAILED');
389 // Cookies not setable!
390 $errorCode = getCode('COOKIES_DISABLED');
392 } elseif (isExtensionInstalledAndNewer('sql_patches', '0.6.1')) {
393 // Update failure counter
394 SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `login_failures`=`login_failures`+1,`last_failure`=NOW() WHERE `userid`=%s LIMIT 1",
395 array($userid), __FUNCTION__, __LINE__);
398 $errorCode = getCode('WRONG_PASS');
400 } elseif ((isUserDataValid()) && (getUserData('status') != 'CONFIRMED')) {
401 // Create an error code from given status
402 $errorCode = generateErrorCodeFromUserStatus(getUserData('status'));
404 // Set userid in session
405 setSession('current_userid', getUserData('userid'));
406 } elseif (!isUserDataValid()) {
408 $errorCode = getCode('WRONG_ID');
411 $errorCode = getCode('UNKNOWN_ERROR');
414 // Error code provided?
415 if ($errorCode > 0) {
416 // Then reconstruct the URL
417 $url = $errorUrl . $errorCode;
419 // Extension set? Then add it as well.
421 $url .= '&ext=' . $ext;
429 // Try to send a new password for the given user account
430 function doNewUserPassword ($email, $userid) {
431 //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'email=' . $email . ',userid=' . $userid . ' - ENTERED!');
432 // Init found-status and error
434 $accountFound = false;
436 // Probe userid/nickname
437 if (!empty($email)) {
439 $accountFound = fetchUserData($email, 'email');
440 } elseif ((isExtensionActive('nickname')) && (isNicknameOrUserid($userid))) {
442 $accountFound = fetchUserData($userid, 'nickname');
443 } elseif ((isValidUserId($userid)) && (empty($email))) {
444 // Direct userid entered
445 $accountFound = fetchUserData($userid);
448 logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',email=' . $email . ': Important variables are empty.');
452 if ($accountFound === true) {
453 // Is the account confirmed
454 if (getUserData('status') == 'CONFIRMED') {
455 // Generate new password
456 $NEW_PASS = generatePassword();
459 SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `password`='%s' WHERE `userid`=%s LIMIT 1",
460 array(generateHash($NEW_PASS), getUserData('userid')), __FUNCTION__, __LINE__);
462 // Prepare data and message for email
463 $message = loadEmailTemplate('guest_new_password',
465 'new_pass' => $NEW_PASS,
466 'nickname' => $userid
467 ), bigintval(getUserData('userid')));
469 // ... and send it away
470 sendEmail(bigintval(getUserData('userid')), '{--GUEST_NEW_PASSWORD--}', $message);
472 // Output note to user
473 displayMessage('{--GUEST_NEW_PASSWORD_SEND--}');
475 // Account is locked or unconfirmed
476 $errorCode = generateErrorCodeFromUserStatus(getUserData('status'));
479 redirectToUrl('modules.php?module=index&what=login&login=' . $errorCode);
482 // id or email is wrong
483 displayMessage('<span class="notice">{--GUEST_WRONG_ID_EMAIL--}</span>');
486 // Return the error code
487 //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'email=' . $email . ',userid=' . $userid . ',errorCode=' . $errorCode . ' - EXIT!');
491 // Get timestamp for given stats type and data
492 function getEpocheTimeFromUserStats ($statsType, $statsData, $userid = '0') {
493 // Default timestamp is zero
494 $data['inserted'] = '0';
497 if ((isMemberIdSet()) && ($userid == '0')) {
498 $userid = getMemberId();
501 // Is the extension installed and updated?
502 if ((!isExtensionActive('sql_patches')) || (isExtensionInstalledAndOlder('sql_patches', '0.5.6'))) {
504 return $data['inserted'];
507 // Try to find the entry
508 $result = SQL_QUERY_ESC("SELECT
509 UNIX_TIMESTAMP(`inserted`) AS inserted
511 `{?_MYSQL_PREFIX?}_user_stats_data`
514 `stats_type`='%s' AND
521 ), __FUNCTION__, __LINE__);
523 // Is the entry there?
524 if (SQL_NUMROWS($result) == 1) {
526 $data = SQL_FETCHARRAY($result);
530 SQL_FREERESULT($result);
533 return $data['inserted'];
536 // Inserts user stats
537 function insertUserStatsRecord ($userid, $statsType, $statsData) {
538 // Is the extension installed and updated?
539 if ((!isExtensionActive('sql_patches')) || (isExtensionInstalledAndOlder('sql_patches', '0.5.6'))) {
545 if ((!getEpocheTimeFromUserStats($statsType, $statsData, $userid)) && (!is_array($statsData))) {
547 SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_stats_data` (`userid`, `stats_type`, `stats_data`) VALUES (%s,'%s','%s')",
552 ), __FUNCTION__, __LINE__);
553 } elseif (is_array($statsData)) {
555 logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',type=' . $statsType . ',data=' . gettype($statsData) . ': Invalid statistics data type!');
559 // Confirms a user account
560 function doConfirmUserAccount ($hash) {
563 'message' => '{--GUEST_CONFIRMED_FAILED--}',
567 // Initialize the user id
570 // Search for an unconfirmed or confirmed account
571 $result = SQL_QUERY_ESC("SELECT `userid`, `refid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `user_hash`='%s' AND (`status`='UNCONFIRMED' OR `status`='CONFIRMED') LIMIT 1",
572 array($hash), __FILE__, __LINE__);
573 if (SQL_NUMROWS($result) == 1) {
574 // Ok, he want's to confirm now so we load some data
575 list($userid, $refid) = SQL_FETCHROW($result);
578 if (!fetchUserData($userid)) {
579 // Not found, should not happen
580 debug_report_bug(__FILE__, __LINE__, 'User account ' . $userid . ' not found.');
583 // Load all data and add points
584 $content = getUserDataArray();
586 // Unlock his account (but only when it is on UNCONFIRMED!)
587 SQL_QUERY_ESC("UPDATE
588 `{?_MYSQL_PREFIX?}_user_data`
590 `status`='CONFIRMED',
594 `status`='UNCONFIRMED'
596 array($hash), __FILE__, __LINE__);
599 if (!SQL_HASZEROAFFECTED()) {
600 // Send email if updated
601 $message = loadEmailTemplate('guest_user_confirmed', $content, bigintval($userid));
603 // And send him right away the confirmation mail
604 sendEmail($userid, '{--GUEST_THANX_CONFIRM--}', $message);
606 // Maybe he got "referaled"?
607 if (($refid > 0) && ($refid != $userid)) {
608 // Select the referal userid
609 if (fetchUserData($refid)) {
610 // Update ref counter...
611 updateReferalCounter($refid);
613 // If version matches add ref bonus to refid's account
614 if ((isExtensionInstalledAndNewer('bonus', '0.4.4')) && (isBonusRallyeActive())) {
615 // Add points (directly only!)
616 SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `bonus_ref`=`bonus_ref`+{?bonus_ref?} WHERE `userid`=%s LIMIT 1",
617 array(bigintval($refid)), __FILE__, __LINE__);
619 // Subtract points from system
620 handleBonusPoints(getConfig('bonus_ref'));
623 // Add one-time referal bonus over referal system or directly
625 addPointsThroughReferalSystem('referal_bonus', $refid, getPointsRef(), bigintval($userid));
629 if (isExtensionActive('rallye')) {
630 // Add user to rallye (or not?)
631 addUserToReferalRallye(bigintval($userid));
634 // Account confirmed!
635 if (isExtensionActive('lead')) {
636 // Set special lead cookie
637 setSession('lead_userid', bigintval($userid));
639 // Lead-Code mode enabled
640 redirectToUrl('lead-confirm.php');
642 $content['message'] = '{--GUEST_CONFIRMED_DONE--}';
643 $content['userid'] = bigintval($userid);
645 } elseif (isExtensionActive('lead')) {
646 // Set special lead cookie
647 setSession('lead_userid', bigintval($userid));
649 // Lead-Code mode enabled
650 redirectToUrl('lead-confirm.php');
652 // Nobody was found unter this hash key... or our new member want's to confirm twice?
653 $content['message'] = '{--GUEST_CONFIRMED_TWICE--}';
656 // Nobody was found unter this hash key... or our new member want's to confirm twice?
657 $content['message'] = '{--GUEST_CONFIRMED_TWICE--}';
661 displayMessage($content['message']);
664 // Does resend the user's confirmation link for given email address
665 function doResendUserConfirmationLink ($email) {
666 // Email address not registered is default message
667 $message = '{--EMAIL_404--}';
669 // Confirmation link requested
670 if (fetchUserData($email, 'email')) {
671 // Email address found
672 $content = getUserDataArray();
674 // Is the account unconfirmed?
675 if ($content['status'] == 'UNCONFIRMED') {
676 // Load email template
677 $message = loadEmailTemplate('guest_request_confirm', array(), $content['userid']);
680 sendEmail($content['userid'], '{--GUEST_REQUEST_CONFIRM_LINK_SUBJECT--}', $message);
683 // Create message based on the status
684 $message = getConfirmationMessageFromUserStatus($content['status']);
688 displayMessage($message);
691 // Get a message (somewhat translation) from user status for confirmation link.
692 // This is different to translateUserStatus() in text messages.
693 function getConfirmationMessageFromUserStatus ($status) {
694 // Default is 'UNKNOWN'
695 $message = '{%message,GUEST_LOGIN_ID_UNKNOWN_STATUS=' . $status . '%}';
697 // Which status is it?
699 case 'UNCONFIRMED': // Account is unconfirmed
701 $message = '{--GUEST_CONFIRM_LINK_SENT--}';
704 case 'CONFIRMED': // Account already confirmed
705 $message = '{--GUEST_LOGIN_ID_CONFIRMED--}';
708 case 'LOCKED': // Account is locked
709 $message = '{--GUEST_LOGIN_ID_LOCKED--}';
712 default: // This should not happen
713 debug_report_bug(__FUNCTION__, __LINE__, 'Unknown user status ' . $status . ' detected.');
721 // Expression call-back function for fetching user data
722 function doExpressionUser ($data) {
723 // Use current userid by default
724 $functionName = 'getMemberId()';
726 // User-related data, so is there a userid?
727 if (!empty($data['matches'][4][$data['key']])) {
728 // Do we have a userid or $userid?
729 if ($data['matches'][4][$data['key']] == '$userid') {
731 $functionName = "getFetchedUserData('userid', \$userid, '" . $data['callback'] . "')";
732 } elseif (!empty($data['matches'][4][$data['key']])) {
734 $functionName = "getFetchedUserData('userid', " . $data['matches'][4][$data['key']] . ", '" . $data['callback'] . "')";
736 } elseif ((!empty($data['callback'])) && (isUserDataValid())) {
737 // "Call-back" alias column for current logged in user's data
738 $functionName = "getUserData('" . $data['callback'] . "')";
741 // Do we have another function to run (e.g. translations)
742 if (!empty($data['extra_func'])) {
743 // Surround the original function call with it
744 $functionName = $data['extra_func'] . '(' . $functionName . ')';
748 $replacer = '{DQUOTE} . ' . $functionName . ' . {DQUOTE}';
750 // Now replace the code
751 $code = replaceExpressionCode($data, $replacer);
753 // Return replaced code
757 // Template call-back function for list_user admin function
758 function doTemplateAdminListUserTitle ($template, $dummy = false) {
759 // Init title with "all accounts"
760 $code = '{--ADMIN_LIST_ALL_ACCOUNTS--}';
762 // Do we have a 'status' or 'mode' set?
763 if (isGetRequestParameterSet('status')) {
764 // Set title according to the 'status'
765 $code = sprintf("{--ADMIN_LIST_STATUS_%s_ACCOUNTS--}", strtoupper(getRequestParameter('status')));
766 } elseif (isGetRequestParameterSet('mode')) {
767 // Set title according to the "mode"
768 $code = sprintf("{--ADMIN_LIST_MODE_%s_ACCOUNTS--}", strtoupper(getRequestParameter('mode')));