private function Post() { $queryWhat = ''; $queryValues = ''; for ($k = 0; $k < count($_POST['values']); $k++) { $variable = htmlspecialchars($_POST['values'][$k][0], ENT_QUOTES); $value = htmlspecialchars($_POST['values'][$k][1], ENT_QUOTES); if ($value == '/') { $value = ''; } if ($variable == 'menuTitleLang') { $vl = $variable . ADMIN_CONFIGURATION::$CONFIG['timeSeconds']; $expl = explode(',', $value); $languagesList = DATABASE::select('admin_languages', '`languageID`', "`isEnabled`='1'", ''); if (count($languagesList) > 0) { for ($l = 0; $l < count($languagesList); $l++) { $insert1 = DATABASE::insert('admin_translation', '`translationTitleLang`,`LanguageID`,`text`,`timeSeconds`,`isEnabled`', "'{$vl}','" . $languagesList[$l]['languageID'] . "','" . $expl[$l] . "','" . CONFIGURATION::$CONFIG['timeSeconds'] . "','1'", 0); if (is_bool($insert1) && $insert1 == true) { echo ''; } else { echo $insert1; } } } $value = $vl; } if ($variable == 'Modal') { if ($value == 'true') { $value = 1; } else { $value = 0; } } if ($variable == 'Parent') { if ($value == -1) { $value = 0; } } if ($k > 0) { $queryWhat .= ',`' . $variable . '`'; } else { $queryWhat = $variable; } if ($k > 0) { $queryValues .= ",'" . $value . "'"; } else { $queryValues = "'" . $value . "'"; } } $insert = DATABASE::insert('admin_menu', $queryWhat . ',`isEnabled`', $queryValues . ",'1'", 0); if (is_bool($insert) && $insert == true) { echo '0'; } else { echo $insert; } }
private function getUserDates() { $user = DATABASE::select('users', '*', "`userID`='" . $_SESSION['userID'] . "' AND `isEnabled`='1'", ''); if (count($user) == 1) { $this->GROUP = $user[0]['userGroup']; $this->EMAIL = $user[0]['email']; $this->USERNAME = $user[0]['userName']; $this->USERLATNAME = $user[0]['userLastName']; $this->USERID = $user[0]['userID']; $this->PASSWORD = $user[0]['password']; $this->LOGIN = $user[0]['userLogin']; $this->ACCESS_ADMIN_PANEL = $user[0]['accessAdminPanel']; } else { print_r($user); } }
public function InfoFile($path, $file) { $getInfoFromDB = DATABASE::select("filemanager", "*", "`path`='" . $path . "' AND `file`='" . $file . "' AND `isEnabled`='1'", ''); if (is_file(dirname(__FILE__) . "/../../../" . $path . '/' . $file)) { $getExtenstion = explode('.', $file); if (in_array($getExtenstion[count($getExtenstion) - 1], $this->extensions)) { self::$Icons[] = $this->icons[array_search($getExtenstion[count($getExtenstion) - 1], $this->extensions)]; } else { self::$Icons[] = 'file-o'; } } else { self::$Icons[] = 'folder'; } $userInfo = new USER($getInfoFromDB[0]['userID']); self::$fileInfo[] = array($file, substr($getInfoFromDB[0]['timestamp'], 0, 10), substr($getInfoFromDB[0]['timestamp'], 10), $userInfo->USERLATNAME); if (is_file(dirname(__FILE__) . "/../../../" . $path . '/' . $file)) { self::$fileInfo[][4] = new ADMIN_TRANSLATION(LANG, 'download', 1, 0); } }
public function OpenFolder($path) { if ($path !== '.') { $dir = opendir(dirname(__FILE__) . "/../../../" . $path); } else { $dir = opendir(dirname(__FILE__) . "/../../../"); } while ($name = readdir($dir)) { $getInfoFromDB = DATABASE::select("filemanager", "`size`,`timestamp`", "`path`='" . $path . "' AND `file`='" . $name . "' AND `isEnabled`='1'", ''); if (count($getInfoFromDB) > 0) { $infoFile = $getInfoFromDB[0]; } else { $insertIntoDB = DATABASE::insert('filemanager', '`file`,`path`,`timeseconds`,`userID`,`isEnabled`,`size`', "'" . $name . "','" . $path . "','" . ADMIN_CONFIGURATION::$CONFIG['timeseconds'] . "','1','1','" . filesize(dirname(__FILE__) . "/../../../" . $path . '/' . $name) . "'", '0'); } if (isset($infoFile)) { $userInfo = new USER($infoFile['userID']); } else { $userInfo = new USER($_SESSION['userID']); } if ($name == '.') { $name = new ADMIN_TRANSLATION(LANG, 'FileManagerRoot', 1, 0); } if ($name == '..') { $name = new ADMIN_TRANSLATION(LANG, 'FileManagerUP', 1, 0); } self::$fileInfo[] = ADMIN_CONFIGURATION::$CONFIG['adminURL'] . LANG . '/filemanager/?modal=1path=' . urlencode($path) . '&file=' . urlencode($name); if (is_file(dirname(__FILE__) . "/../../../" . $path . '/' . $name)) { $getExtenstion = explode('.', $name); if (in_array($getExtenstion[count($getExtenstion) - 1], $this->extensions)) { self::$Icons[] = $this->icons[array_search($getExtenstion[count($getExtenstion) - 1], $this->extensions)]; } else { self::$Icons[] = 'file-o'; } } else { self::$Icons[] = 'folder'; } self::$files[] = array($name, $userInfo->USERNAME . ' ' . $userInfo->USERLATNAME, $infoFile['size'], $infoFile['timestamp']); } }
private function FindPageInDB() { //echo $this->LANG.' '.$this->MODULE.' '.$this->ID; $getPage = parent::select('modules', '`moduleDirectory`', "`moduleTitle`='{$this->MODULE}'", ''); if (count($getPage) == 0) { header("HTTP/1.0 404 Not Found"); require_once dirname(__FILE__) . '/../../common/views/404.php'; exit; } }