Server IP : 80.241.246.6 / Your IP : 216.73.216.188 Web Server : Apache/2.4.25 (Debian) System : Linux kharagauli 4.9.0-19-amd64 #1 SMP Debian 4.9.320-2 (2022-06-30) x86_64 User : www-data ( 33) PHP Version : 7.0.33-0+deb9u12 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/kharagauli_new/moduls/users/admin/ |
Upload File : |
<?php /* @author suxoza <suxoza@gmail.com> */ if(realpath(__FILE__) == realpath($_SERVER['SCRIPT_FILENAME']))die("__main__"); try{ $arr = [ ['name'], [] ]; if(!isset($_POST['name'],$_POST['pass'])) throw new Exception("Error Processing Request", 1); if(in_array('more', $url)){ if(!$_->permission_('users','edit')) throw new Exception("Error Processing Request", 1); if(!isset($url[3])) throw new Exception("Error Processing Request", 1); if(isset($_POST['pass']) && $_POST['pass']) array_push($arr[0],"pass","permission"); else array_push($arr[0],"permission"); to_json($arr); $arr[0][] = "modify_date"; $arr[1][] = time(); $arr[2] = ["id",(int)$url[3]]; if($_->update("users",$arr)) header("Location:".urldecode($_SERVER['REQUEST_URI'])); else die("update error!!!!!"); }elseif(in_array('new', $url)){ if(!$_->permission_('users','add')) throw new Exception("Error Processing Request", 1); array_push($arr[0],"pass","permission"); to_json($arr); $arr[0][] = "date"; $arr[1][] = time(); if($_->insert("users",$arr,'b_clier')) header("Location:/მომხმარებლები"); else die("insert error!!!!!"); } }catch(Exception $exc) { die($exc->getMessage()); } function to_json(&$arr){ $permission = []; foreach ($_POST as $key => $value) { if(in_array($key, ['name','pass'])){ if($value) $arr[1][] = ($key == 'name')?$value:md5($value); continue; } list($table,$event,$id) = explode('_',$key); if($table == 'menus') $permission[$id][] = $event; else $permission[$table][] = $event; } $arr[1][] = json_encode($permission); } ?>