Skip to content
Permalink
Browse files
Merge pull request #680 from tarasfrompir/patch-19
Убран дубляж - $session->data['logged_user'] все перенесено в $session->data['SITE_USER_ID']
  • Loading branch information
sergejey committed Feb 5, 2020
2 parents 0462d8d + 7d55c37 commit 4f0a4ad6d03d8b229ca520094534e9084fb4db71
Showing 2 changed files with 7 additions and 10 deletions.
@@ -125,7 +125,7 @@ function admin(&$out) {

global $delete_room;
if ($delete_room!='' && LOGGED_USER) {
$room=SQLSelectOne("SELECT * FROM shoutrooms WHERE ID='".(int)$delete_room."' AND ADDED_BY=".(int)$session->data['logged_user']);
$room=SQLSelectOne("SELECT * FROM shoutrooms WHERE ID='".(int)$delete_room."' AND ADDED_BY=".(int)$session->data['SITE_USER_ID']);
if ($room['ID']) {
SQLExec("DELETE FROM shouts WHERE ROOM_ID=".$room['ID']);
SQLExec("DELETE FROM shoutrooms WHERE ID='".$room['ID']."'");
@@ -146,12 +146,12 @@ function admin(&$out) {
$this->redirect("/chat/room".$room['ID'].'.html');
}

if ($this->mode=='newroom' && $session->data['logged_user']) {
if ($this->mode=='newroom' && $session->data['LOGGED_USER_ID']) {
$rec=array();
global $room_title;
global $make_public;
$rec['TITLE']=htmlspecialchars($room_title);
$rec['ADDED_BY']=$session->data['logged_user'];
$rec['ADDED_BY']=$session->data['LOGGED_USER_ID'];
$rec['ADDED']=date('Y-m-d H:i:s');
$rec['IS_PUBLIC']=(int)$make_public;
if ($rec['TITLE']) {
@@ -250,4 +250,4 @@ function dbInstall($data) {
* TW9kdWxlIGNyZWF0ZWQgSmFuIDMwLCAyMDA3IHVzaW5nIFNlcmdlIEouIHdpemFyZCAoQWN0aXZlVW5pdCBJbmMgd3d3LmFjdGl2ZXVuaXQuY29tKQ==
*
*/
?>
?>
@@ -21,12 +21,9 @@

if (!$session->data['SITE_USERNAME']) {
$out['NOT_LOGGED']=1;
} else {
$user=SQLSelectOne("SELECT * FROM users WHERE USERNAME='".DBSafe($session->data['SITE_USERNAME'])."'");
$session->data['logged_user']=$user['ID'];
}

if ($this->action=='' && $session->data['logged_user'] && $msg!='') {
if ($this->action=='' && $session->data['SITE_USER_ID'] && $msg!='') {

if ($session->data['TERMINAL']) {
$terminal_rec = getTerminalsByName($session->data['TERMINAL'], 1)[0];
@@ -39,7 +36,7 @@
SQLUpdate('terminals', $terminal_rec);
}
}
say(htmlspecialchars($msg), 0, $session->data['logged_user'], 'terminal'.$terminal_rec['ID']);
say(htmlspecialchars($msg), 0, $session->data['SITE_USER_ID'], 'terminal'.$terminal_rec['ID']);
/*
$rec=array();
$rec['ROOM_ID']=(int)$room_id;
@@ -198,4 +195,4 @@
}


?>
?>

0 comments on commit 4f0a4ad

Please sign in to comment.