php 8 fix add staticFetch
This commit is contained in:
parent
cf7841409a
commit
698b979173
5 changed files with 27 additions and 6 deletions
|
@ -1009,7 +1009,7 @@ else if($_REQUEST['action'] == 'completeAddressBookEntry'
|
|||
$book->InvalidateSelfCompleteInvitation($contactID, $key);
|
||||
|
||||
// send mail
|
||||
$userData = BMUser::Fetch($contactData['user']);
|
||||
$userData = BMUser::staticFetch($contactData['user']);
|
||||
$vars = array(
|
||||
'vorname' => $contactData['vorname'],
|
||||
'nachname' => $contactData['nachname']
|
||||
|
|
|
@ -817,7 +817,7 @@ class BMCalendar
|
|||
if($userID == -1)
|
||||
{
|
||||
if($this->_userID != $userRow['id'])
|
||||
$userRow = BMUser::Fetch($this->_userID);
|
||||
$userRow = BMUser::staticFetch($this->_userID);
|
||||
$firstDay = $userRow['c_firstday'];
|
||||
$datesStart = mktime(0, 0, 0, $month, 1, $year);
|
||||
$datesEnd = mktime(23, 59, 59, $month, $daysInMonth, $year);
|
||||
|
@ -828,7 +828,7 @@ class BMCalendar
|
|||
else
|
||||
{
|
||||
if($userID != $userRow['id'])
|
||||
$userRow = BMUser::Fetch($userID);
|
||||
$userRow = BMUser::staticFetch($userID);
|
||||
$firstDay = $userRow['c_firstday'];
|
||||
$userCalendar = _new('BMCalendar', array($userID));
|
||||
$datesStart = mktime(0, 0, 0, $month, 1, $year);
|
||||
|
|
|
@ -1886,7 +1886,7 @@ class BMMailbox
|
|||
|
||||
// TODO: shared folders
|
||||
|
||||
$userInfo = BMUser::Fetch($this->_userID);
|
||||
$userInfo = BMUser::staticFetch($this->_userID);
|
||||
|
||||
// select new mails
|
||||
$res = $db->Query('SELECT COUNT(*) FROM {pre}mails WHERE '
|
||||
|
|
|
@ -1170,7 +1170,7 @@ class BMUser
|
|||
if(isset($pluginAuth['profile'])
|
||||
&& $row['gesperrt'] == 'no')
|
||||
{
|
||||
$theOldUserRow = $theUserRow = BMUser::Fetch($row['id']);
|
||||
$theOldUserRow = $theUserRow = BMUser::staticFetch($row['id']);
|
||||
|
||||
$theUserRow['passwort'] = md5($password.$row['passwort_salt']);
|
||||
foreach($pluginAuth['profile'] as $key=>$val)
|
||||
|
@ -1432,6 +1432,27 @@ class BMUser
|
|||
return($row);
|
||||
}
|
||||
|
||||
/**
|
||||
* fetch a user row (static function)
|
||||
*
|
||||
* @param int $id
|
||||
* @return array
|
||||
*/
|
||||
public static function staticFetch($id)
|
||||
{
|
||||
global $db;
|
||||
if(!isset($id))
|
||||
return false;
|
||||
$res = $db->Query('SELECT * FROM {pre}users WHERE id=?',
|
||||
$id);
|
||||
if($res->RowCount() == 0)
|
||||
return(false);
|
||||
$row = $res->FetchArray(MYSQLI_ASSOC);
|
||||
$res->Free();
|
||||
|
||||
return($row);
|
||||
}
|
||||
|
||||
/**
|
||||
* refresh user row
|
||||
*
|
||||
|
|
|
@ -445,7 +445,7 @@ class BMWebdisk
|
|||
}
|
||||
else
|
||||
{
|
||||
$userRow = BMUser::Fetch($this->_userID);
|
||||
$userRow = BMUser::staticFetch($this->_userID);
|
||||
$info = array(
|
||||
'id' => 0,
|
||||
'type' => WEBDISK_ITEM_FOLDER,
|
||||
|
|
Loading…
Reference in a new issue