Ajout d'une fonction pour get_uid_by_login en php

Test pour eviter de lever des errerurs lorsqu'on utilise le cli
This commit is contained in:
Alan Garcia 2013-09-18 09:18:10 +00:00
parent 5ea431a421
commit b260ab4ff9
2 changed files with 13 additions and 0 deletions

View File

@ -145,6 +145,17 @@ class m_admin {
}
}
# return the uid of an alternc account
function get_uid_by_login($login) {
global $db;
$db->query("SELECT uid FROM membres WHERE login='$login';");
if (! $db->next_record()) {
return null;
}
return $db->f('uid');
}
/* ----------------------------------------------------------------- */
/** Returns the known information about a hosted account
*

View File

@ -613,6 +613,7 @@ Cordially.
function session_tempo_params_get($v) {
global $uid;
if (empty($_COOKIE['session'])) return false;
$sid=$_COOKIE['session'];
if ( empty($_SESSION[$sid.'-'.$uid]) ) { // si pas de session de params tempo
return false;
@ -627,6 +628,7 @@ Cordially.
function session_tempo_params_set($k, $v, $ecrase=false) {
global $uid;
if (empty($_COOKIE['session'])) return false;
$sid=$_COOKIE['session'];
$p=Array();
if ( ! empty($_SESSION[$sid.'-'.$uid]) ) {