Removes calls to get_user_forlife in Search and XnetEvents modules.
authorVincent Zanotti <vincent.zanotti@polytechnique.org>
Sun, 27 Jul 2008 22:08:39 +0000 (00:08 +0200)
committerVincent Zanotti <vincent.zanotti@polytechnique.org>
Sun, 27 Jul 2008 22:08:39 +0000 (00:08 +0200)
Definitively remove get_user_forlife from user.func.inc.php.

Signed-off-by: Vincent Zanotti <vincent.zanotti@polytechnique.org>
include/user.func.inc.php
modules/search.php
modules/xnetevents/xnetevents.inc.php

index 0030770..c3db0f7 100644 (file)
@@ -271,14 +271,6 @@ function get_users_login_list($members, $strict = false, $get_forlife = false, $
 }
 
 // }}}
-// {{{ function get_user_forlife()
-
-function get_user_forlife($data, $callback = '_default_user_callback')
-{
-    return get_user_login($data, true, $callback);
-}
-
-// }}}
 // {{{ function get_users_forlife_list()
 
 function get_users_forlife_list($members, $strict = false, $callback = '_default_user_callback')
index a21500c..4bbbfc0 100644 (file)
@@ -94,7 +94,7 @@ class SearchModule extends PLModule
                 $list .= '|admin|adm|ax';
             }
             if (preg_match('/^(' . $list . '):([-a-z]+(\.[-a-z]+(\.\d{2,4})?)?)$/', replace_accent($quick), $matches)) {
-                $forlife = $matches[2];
+                $login = $matches[2];
                 switch($matches[1]) {
                   case 'admin': case 'adm':
                     $base = 'admin/user/';
@@ -110,10 +110,9 @@ class SearchModule extends PLModule
                     break;
                 }
 
-                require_once 'user.func.inc.php';
-                $login = get_user_forlife($forlife, '_silent_user_callback');
-                if ($login) {
-                    pl_redirect($base . $login);
+                $user = User::getSilent($login);
+                if ($user) {
+                    pl_redirect($base . $user->login());
                 }
                 $_REQUEST['quick'] = $forlife;
                 $_GET['quick'] = $forlife;
index 4a69b7a..8e74de6 100644 (file)
@@ -201,17 +201,15 @@ function get_event_participants(&$evt, $item_id, $tri, $limit = '') {
 //  {{{ function subscribe_lists_event()
 function subscribe_lists_event($participate, $uid, $evt)
 {
-    require_once('user.func.inc.php');
     global $globals;
     $page =& Platal::page();
 
     $participant_list = $evt['participant_list'];
     $absent_list      = $evt['absent_list'];
 
-    $email = get_user_forlife($uid, '_silent_user_callback');
-
-    if ($email) {
-        $email .= '@'.$globals->mail->domain;
+    $user = User::getSilent($uid);
+    if ($user) {
+        $email = $user->forlifeEmail();
     } else {
         $res = XDB::query("SELECT email
                              FROM groupex.membres