?¡ëPNG
IHDR ? f ??C1 sRGB ??¨¦ gAMA ¡À?¨¹a pHYs ? ??o¡§d GIDATx^¨ª¨¹L¡±¡Âe¡ÂY?a?("Bh?_¨°???¡é¡ì?q5k?*:t0A-o??£¤]VkJ¡éM??f?¡À8\k2¨ªll¡ê1]q?¨´???T
Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in /home/user1137782/www/china1.by/classwithtostring.php on line 86
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 213
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 214
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 215
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 216
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 217
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 218
@include_once("../../cms.conf");
require_once ($INCLUDE_FOLDER.'database.inc.php');
function GetSiteBySection ($SectionID)
{
global $LinkID;
$select = "SELECT `Site_ID` FROM `".(LOWER_CASE_TABLES ? "section" : "Section")."` WHERE `Section_ID`='".$SectionID."'";
#print $select."
\n";
$Result = mysql_query ($select, $LinkID);
@$ResultArray = mysql_fetch_row ($Result);
return $ResultArray[0];
}
function GetSiteNameByID ($SiteID)
{
global $LinkID;
$select = "SELECT `Site_Name` FROM `".(LOWER_CASE_TABLES ? "site" : "Site")."` WHERE `Site_ID`='".$SiteID."'";
#print $select."
\n";
$Result = mysql_query ($select, $LinkID);
#echo mysql_errno().": ".mysql_error()."
";
@$ResultArray = mysql_fetch_row ($Result);
return $ResultArray[0];
}
function GetSectionNameByID ($SectionID)
{
global $LinkID;
$select = "SELECT `Section_Name` FROM `".(LOWER_CASE_TABLES ? "section" : "Section")."` WHERE `Section_ID`='".$SectionID."'";
$Result = mysql_query ($select, $LinkID);
@$ResultArray = mysql_fetch_row ($Result);
return $ResultArray[0];
}
function GetSiteNameBySectionID ($SectionID)
{
global $LinkID;
$select = "SELECT `Site_Name` FROM `Site`,`Section` WHERE `Section_ID`='";
$select .= $SectionID."'";
$select .= " AND `Section`.`Site_ID`=`Site`.`Site_ID`;";
$Result = mysql_query ($select, $LinkID);
#echo mysql_errno().": ".mysql_error()."
";
$ResultArray = mysql_fetch_row ($Result);
return $ResultArray[0];
}
function GetSectionIDByDataID ($DataID, $ObjectID)
{
global $LinkID;
$select = "SELECT `Section_ID` FROM `Data".$ObjectID."` WHERE ";
$select .= "`Data_ID`='".$DataID."'";
#print $select."
";
$Result = mysql_query ($select, $LinkID);
$ResultArray = mysql_fetch_row ($Result);
return $ResultArray[0];
}
function DeleteAllUser_Access ($UserID)
{
global $LinkID;
$delete = "DELETE FROM `".(LOWER_CASE_TABLES ? "user_access" : "User_Access")."` WHERE `User_ID`='".$UserID."'";
if ( mysql_query ($delete, $LinkID) )
return 1;
else
return 0;
}
function DeleteInSubscribe ($UserID)
{
global $LinkID;
$delete = "DELETE FROM `".(LOWER_CASE_TABLES ? "subscriber" : "Subscriber")."` WHERE `User_ID`='".$UserID."'";
if ( mysql_query ($delete, $LinkID) )
return 1;
else
return 0;
}
function GetEmailByUserID ($UserID)
{
global $LinkID;
$Select = "SELECT `Email` FROM `".(LOWER_CASE_TABLES ? "user" : "User")."` WHERE `User_ID`='";
$Select .= $UserID."'";
#print $Select."
\n";
$SelectResult = mysql_query ($Select, $LinkID);
$ResultArray = mysql_fetch_row ($SelectResult);
return $ResultArray[0];
}
function SendEmail ($UserID, $Subject, $Data, $From)
{
global $LinkID;
$Email = GetEmailByUserID ($UserID);
#print "Email=".$Email."
\n";
mail ($Email, $Subject, $Data, "From: ".$From."\nX-Mailer: PHP/" . phpversion()."\nContent-Type: text/plain; charset=koi8-r\nContent-Transfer-Encoding: 8bit\n" );
}
function SendEmailFromEmail ($Email, $Subject, $Data, $From)
{
global $LinkID;
mail ($Email, $Subject, $Data, "From: ".$From."\nX-Mailer: PHP/" . phpversion()."\nContent-Type: text/plain; charset=koi8-r\nContent-Transfer-Encoding: 8bit\nReturn-Path: <".$From.">");
}
class User_Access {
var $ARRAY, $COUNT;
var $UserID;
var $User_GroupID;
var $User_Group;
function User_Access ($UserID, $User_GroupID=0, $CountUser_GroupID=1)
{
global $LinkID;
$this->UserID = $UserID;
if ($User_GroupID == 0) {
if ($CountUser_GroupID == 1) $this->User_GroupID = GetUser_GroupID ($UserID);
} else {
$this->User_GroupID = $User_GroupID;
}
#print "UserID=".$this->UserID."
\n";
#print "User_GroupID=".$this->User_GroupID."
\n";
$SelectPerm = "SELECT `User_Access_ID`,`AdminType`,`Site_ID`,`User_AccessSet` FROM `".(LOWER_CASE_TABLES ? "user_access" : "User_Access")."`";
$SelectPerm .= " WHERE ";
if ($this->UserID > 0) $SelectPerm .= " User_ID='".$UserID."'";
if ($this->User_GroupID > 0) {
if ($this->UserID > 0) $SelectPerm .= " or ";
$SelectPerm .= " User_Group_ID='".$this->User_GroupID."'";
}
#print $SelectPerm."
\n";
for ($i=1; $i <= UserTypeCount; $i++) {
$this->COUNT [$i] = 0;
}
$PermResult = mysql_query ($SelectPerm, $LinkID);
while ( @$PermArray = mysql_fetch_row ($PermResult) ) {
#print $PermArray[0]." ".$PermArray[1]." ".$PermArray[2]." ".$PermArray[3]."
\n";
$this->ARRAY [ $PermArray[1] ][ $this->COUNT[$PermArray[1]] ][0] = $PermArray[2];
$this->ARRAY [ $PermArray[1] ][ $this->COUNT[$PermArray[1]] ][1] = $PermArray[0];
$this->ARRAY [ $PermArray[1] ][ $this->COUNT[$PermArray[1]] ][2] = $PermArray[3];
$this->COUNT[$PermArray[1]]++;
}
$res = mysql_query("SELECT `User_Group_Name` FROM `".(LOWER_CASE_TABLES ? "user_group" : "User_Group")."` WHERE `User_Group_ID` = " . $this->User_GroupID);
@$this->User_Group = mysql_result($res, 0);
}
function printPerm ()
{
for ($i=UserTypeCount; $i > 0; $i--) {
for ($t=0; $t < $this->COUNT[$i]; $t++)
if ( isset($this->ARRAY[$i][$t][0]) ) {
print $this->ARRAY[$i][$t][0]." ";
print $this->ARRAY[$i][$t][1]." ";
print $this->ARRAY[$i][$t][2]." ";
}
print "
\n";
}
}
function getLogin ()
{
global $LinkID;
global $CMS_AUTHORIZE_FIELD;
$select = "SELECT `$CMS_AUTHORIZE_FIELD` FROM `".(LOWER_CASE_TABLES ? "user" : "User")."` WHERE `User_ID`='".$this->UserID."'";
#print select."
\n";
$Result = mysql_query ($select, $LinkID);
$Array = mysql_fetch_row ($Result);
return $Array[0];
}
function isDirector ()
{
if ( isset($this->ARRAY[DIRECTOR][0][0]) )
return 1;
else
return 0;
}
function isGuest ()
{
global $PERM_ARRAY, $PERM_COUNT;
if ( isset($this->ARRAY[GUEST][0]) && !$this->isSupervisor() )
return 1;
else
return 0;
}
function isSupervisor ()
{
if ( $this->isDirector () ) return 1;
if ( isset($this->ARRAY[SUPERVISOR][0][0]) )
return 1;
else
return 0;
}
function isManager ()
{
if ( isset($this->ARRAY[MANAGER][0][0]) )
return 1;
else
return 0;
}
function isSiteAdmin ($SiteID)
{
$ReturnValue = 0;
for ($i=0; $i < MAX_CATALOGUE_NUMBER; $i++) {
if ( !isset ($this->ARRAY[CATALOGUE_ADMIN][$i][0]) ) break;
if ( ($this->ARRAY[CATALOGUE_ADMIN][$i][0] == $SiteID) && ($this->ARRAY[CATALOGUE_ADMIN][$i][2] & 32) ) {
$ReturnValue = 1;
break;
}
}
return $ReturnValue;
}
function IsAnySiteAdmin ()
{
if ((isset($this->ARRAY[CATALOGUE_ADMIN][0][0])) && ($this->ARRAY[CATALOGUE_ADMIN][0][2] & 32) )
return 1;
else
return 0;
}
function isSectionAdmin ($SectionID)
{
$ReturnValue = 0;
for ($i=0; $i < MAX_SUBDIVISION_NUMBER; $i++) {
if ( !isset ($this->ARRAY[SUBDIVISION_ADMIN][$i][0]) ) break;
if ( ( $this->ARRAY[SUBDIVISION_ADMIN][$i][0] == $SectionID ) && ($this->ARRAY[SUBDIVISION_ADMIN][$i][2] & 32) ) {
$ReturnValue = 1;
break;
}
}
return $ReturnValue;
}
function IsAnySectionAdmin ()
{
if ( (isset($this->ARRAY[SUBDIVISION_ADMIN][0][0]) ) && ($this->ARRAY[SUBDIVISION_ADMIN][0][2] & 32) )
return 1;
else
return 0;
}
function isSite ($SiteID, $mask)
{
$ReturnValue = 0;
for ($i=0; $i < MAX_CATALOGUE_NUMBER; $i++) {
if ( !isset ($this->ARRAY[CATALOGUE_ADMIN][$i][0]) ) break;
if ( ($this->ARRAY[CATALOGUE_ADMIN][$i][0] == $SiteID) && ($this->ARRAY[CATALOGUE_ADMIN][$i][2] & $mask) ) {
$ReturnValue = 1;
break;
}
}
return $ReturnValue;
}
function isSection ($SectionID, $mask)
{
$ReturnValue = 0;
for ($i=0; $i < MAX_SUBDIVISION_NUMBER; $i++) {
if ( !isset ($this->ARRAY[SUBDIVISION_ADMIN][$i][0]) ) break;
if ( ( $this->ARRAY[SUBDIVISION_ADMIN][$i][0] == $SectionID ) && ($this->ARRAY[SUBDIVISION_ADMIN][$i][2] & $mask) ) {
$ReturnValue = 1;
break;
}
}
return $ReturnValue;
}
function isSectionObjectAdmin ($SectionObjectID)
{
$ReturnValue = 0;
for ($i=0; $i < MAX_SUBDIVISION_NUMBER; $i++) {
if ( !isset ($this->ARRAY[SUB_CLASS_ADMIN][$i][0]) ) break;
if ( ( $this->ARRAY[SUB_CLASS_ADMIN][$i][0] == $SectionObjectID ) && ($this->ARRAY[SUB_CLASS_ADMIN][$i][2] & 32) ) {
$ReturnValue = 1;
break;
}
}
return $ReturnValue;
}
function isAnySectionObjectAdmin ()
{
if ( (isset($this->ARRAY[SUB_CLASS_ADMIN][0][0]) ) && ($this->ARRAY[SUB_CLASS_ADMIN][0][2] & 31) )
return 1;
else
return 0;
}
function isSectionObject ($SectionObjectID, $mask)
{
$ReturnValue = 0;
for ($i=0; $i < MAX_SUBDIVISION_NUMBER; $i++) {
if ( !isset ($this->ARRAY[SUB_CLASS_ADMIN][$i][0]) ) break;
if ( ( $this->ARRAY[SUB_CLASS_ADMIN][$i][0] == $SectionObjectID ) && ($this->ARRAY[SUB_CLASS_ADMIN][$i][2] & $mask) ) {
$ReturnValue = 1;
break;
}
}
return $ReturnValue;
}
function ExitIfGuest ()
{
if ( $this->isGuest() ) {
NoRightsMessage();
EndHtml ();
exit;
}
}
function ExitIfNotSupervisor ()
{
if ( !$this->isSupervisor() ) {
NoRightsMessage();
EndHtml ();
exit;
}
}
function ExitIfNotSupervisorManager ()
{
if ( !($this->isSupervisor() || $this->isManager()) ) {
NoRightsMessage();
EndHtml ();
exit;
}
}
function ExitIfNotSupervisorGuest ()
{
if ( ! ($this->isSupervisor() || $this->isGuest() ) ) {
NoRightsMessage();
EndHtml ();
exit;
}
}
function ExitIfNotSupervisorManagerSiteAdmin ($SiteID)
{
if ( !($this->isSupervisor() || $this->isManager() || $this->isSiteAdmin($SiteID) ) ) {
NoRightsMessage();
EndHtml ();
exit;
}
}
function ExitIfNotSupervisorManagerSiteSectionAdmin ($SiteID, $SectionID)
{
if ( !($this->isSupervisor() || $this->isManager() || $this->isSiteAdmin($SiteID) || $this->isSectionAdmin($SectionID) ) ) {
NoRightsMessage();
EndHtml ();
exit;
}
}
}
?>