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:
parent
5ea431a421
commit
b260ab4ff9
|
@ -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
|
||||
*
|
||||
|
|
|
@ -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]) ) {
|
||||
|
|
Loading…
Reference in New Issue