authenticated) : die("Why you trying to access this without logging in?!?!"); elseif($USER->authenticated && $USER->role !== "admin") : die("C'mon man! I give you access to my stuff and now you're trying to get in the back door?"); endif; function printArray($arrayName){ foreach ( $arrayName as $item ) : echo $item . "
"; endforeach; } function explosion($string, $position){ $getWord = explode("|", $string); return $getWord[$position]; } function write_ini_file($content, $path) { if (!$handle = fopen($path, 'w')) { return false; } $success = fwrite($handle, $content); fclose($handle); return $success; } function getServerPath() { if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') { $protocol = "https://"; } else { $protocol = "http://"; } return $protocol . $_SERVER['SERVER_NAME'] . dirname($_SERVER['REQUEST_URI']); } function get_browser_name() { $user_agent = $_SERVER['HTTP_USER_AGENT']; if (strpos($user_agent, 'Opera') || strpos($user_agent, 'OPR/')) return 'Opera'; elseif (strpos($user_agent, 'Edge')) return 'Edge'; elseif (strpos($user_agent, 'Chrome')) return 'Chrome'; elseif (strpos($user_agent, 'Safari')) return 'Safari'; elseif (strpos($user_agent, 'Firefox')) return 'Firefox'; elseif (strpos($user_agent, 'MSIE') || strpos($user_agent, 'Trident/7')) return 'Internet Explorer'; return 'Other'; } $dbfile = DATABASE_LOCATION . constant('User::DATABASE_NAME') . ".db"; $databaseLocation = "databaseLocation.ini.php"; $userdirpath = USER_HOME; $userdirpath = substr_replace($userdirpath, "", -1); $file_db = new PDO("sqlite:" . $dbfile); $file_db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $getUsers = $file_db->query('SELECT * FROM users'); $gotUsers = $file_db->query('SELECT * FROM users'); $dbTab = $file_db->query('SELECT name FROM sqlite_master WHERE type="table" AND name="tabs"'); $dbOptions = $file_db->query('SELECT name FROM sqlite_master WHERE type="table" AND name="options"'); $tabSetup = "Yes"; $hasOptions = "No"; foreach($dbTab as $row) : if (in_array("tabs", $row)) : $tabSetup = "No"; endif; endforeach; foreach($dbOptions as $row) : if (in_array("options", $row)) : $hasOptions = "Yes"; endif; endforeach; if($hasOptions == "No") : $title = "Organizr"; $topbar = "#eb6363"; $topbartext = "#FFFFFF"; $bottombar = "#eb6363"; $sidebar = "#000000"; $hoverbg = "#eb6363"; $hovertext = "#000000"; $activetabBG = "#eb6363"; $activetabicon = "#FFFFFF"; $activetabtext = "#FFFFFF"; $inactiveicon = "#FFFFFF"; $inactivetext = "#FFFFFF"; $loading = "#000000"; endif; if($tabSetup == "No") : $result = $file_db->query('SELECT * FROM tabs'); endif; if($hasOptions == "Yes") : $resulto = $file_db->query('SELECT * FROM options'); endif; if($hasOptions == "Yes") : foreach($resulto as $row) : $title = $row['title']; $topbartext = $row['topbartext']; $topbar = $row['topbar']; $bottombar = $row['bottombar']; $sidebar = $row['sidebar']; $hoverbg = $row['hoverbg']; @$hovertext = $row['hovertext']; $activetabBG = $row['activetabBG']; $activetabicon = $row['activetabicon']; $activetabtext = $row['activetabtext']; $inactiveicon = $row['inactiveicon']; $inactivetext = $row['inactivetext']; @$loading = $row['loading']; endforeach; endif; $action = ""; if(isset($_POST['action'])) : $action = $_POST['action']; endif; if($action == "deleteDB") : unset($_COOKIE['Organizr']); setcookie('Organizr', '', time() - 3600, '/'); unset($_COOKIE['OrganizrU']); setcookie('OrganizrU', '', time() - 3600, '/'); $file_db = null; unlink($dbfile); foreach(glob($userdirpath . '/*') as $file) : if(is_dir($file)) : rmdir($file); elseif(!is_dir($file)) : unlink($file); endif; endforeach; rmdir($userdirpath); echo ""; endif; if($action == "deleteLog") : unlink(FAIL_LOG); echo ""; endif; if($action == "upgrade") : function downloadFile($url, $path){ $folderPath = "upgrade/"; if(!mkdir($folderPath)) : echo "can't make dir"; endif; $newfname = $folderPath . $path; $file = fopen ($url, 'rb'); if ($file) { $newf = fopen ($newfname, 'wb'); if ($newf) { while(!feof($file)) { fwrite($newf, fread($file, 1024 * 8), 1024 * 8); } } } if ($file) { fclose($file); } if ($newf) { fclose($newf); } } function unzipFile($zipFile){ $zip = new ZipArchive; $extractPath = "upgrade/"; if($zip->open($extractPath . $zipFile) != "true"){ echo "Error :- Unable to open the Zip File"; } /* Extract Zip File */ $zip->extractTo($extractPath); $zip->close(); } // Function to remove folders and files function rrmdir($dir) { if (is_dir($dir)) { $files = scandir($dir); foreach ($files as $file) if ($file != "." && $file != "..") rrmdir("$dir/$file"); rmdir($dir); } else if (file_exists($dir)) unlink($dir); } // Function to Copy folders and files function rcopy($src, $dst) { if (is_dir ( $src )) { if (!file_exists($dst)) : mkdir ( $dst ); endif; $files = scandir ( $src ); foreach ( $files as $file ) if ($file != "." && $file != "..") rcopy ( "$src/$file", "$dst/$file" ); } else if (file_exists ( $src )) copy ( $src, $dst ); } $url = "https://github.com/causefx/Organizr/archive/master.zip"; $file = "upgrade.zip"; $source = __DIR__ . "/upgrade/Organizr-master/"; $cleanup = __DIR__ . "/upgrade/"; $destination = __DIR__ . "/"; downloadFile($url, $file); unzipFile($file); rcopy($source, $destination); rrmdir($cleanup); echo ""; endif; if($action == "createLocation") : $databaseData = '; ' . "\r\n"; foreach ($_POST as $postName => $postValue) { if($postName !== "action") : if(substr($postValue, -1) == "/") : $postValue = rtrim($postValue, "/"); endif; $databaseData .= $postName . " = \"" . $postValue . "\"\r\n"; endif; } write_ini_file($databaseData, $databaseLocation); echo ""; endif; if(!isset($_POST['op'])) : $_POST['op'] = ""; endif; if($action == "addTabz") : if($tabSetup == "No") : $file_db->exec("DELETE FROM tabs"); endif; if($tabSetup == "Yes") : $file_db->exec("CREATE TABLE tabs (name TEXT UNIQUE, url TEXT, defaultz TEXT, active TEXT, user TEXT, guest TEXT, icon TEXT, iconurl TEXT, window TEXT)"); endif; $addTabName = array(); $addTabUrl = array(); $addTabIcon = array(); $addTabIconUrl = array(); $addTabDefault = array(); $addTabActive = array(); $addTabUser = array(); $addTabGuest = array(); $addTabWindow = array(); $buildArray = array(); foreach ($_POST as $key => $value) : $trueKey = explode('-', $key); if ($value == "on") : $value = "true"; endif; if($trueKey[0] == "name"): array_push($addTabName, $value); endif; if($trueKey[0] == "url"): array_push($addTabUrl, $value); endif; if($trueKey[0] == "icon"): array_push($addTabIcon, $value); endif; if($trueKey[0] == "iconurl"): array_push($addTabIconUrl, $value); endif; if($trueKey[0] == "default"): array_push($addTabDefault, $value); endif; if($trueKey[0] == "active"): array_push($addTabActive, $value); endif; if($trueKey[0] == "user"): array_push($addTabUser, $value); endif; if($trueKey[0] == "guest"): array_push($addTabGuest, $value); endif; if($trueKey[0] == "window"): array_push($addTabWindow, $value); endif; endforeach; $tabArray = 0; if(count($addTabName) > 0) : foreach(range(1,count($addTabName)) as $index) : if(!isset($addTabDefault[$tabArray])) : $tabDefault = "false"; else : $tabDefault = $addTabDefault[$tabArray]; endif; $buildArray[] = array('name' => $addTabName[$tabArray], 'url' => $addTabUrl[$tabArray], 'defaultz' => $tabDefault, 'active' => $addTabActive[$tabArray], 'user' => $addTabUser[$tabArray], 'guest' => $addTabGuest[$tabArray], 'icon' => $addTabIcon[$tabArray], 'window' => $addTabWindow[$tabArray], 'iconurl' => $addTabIconUrl[$tabArray]); $tabArray++; endforeach; endif; $insert = "INSERT INTO tabs (name, url, defaultz, active, user, guest, icon, iconurl, window) VALUES (:name, :url, :defaultz, :active, :user, :guest, :icon, :iconurl, :window)"; $stmt = $file_db->prepare($insert); $stmt->bindParam(':name', $name); $stmt->bindParam(':url', $url); $stmt->bindParam(':defaultz', $defaultz); $stmt->bindParam(':active', $active); $stmt->bindParam(':user', $user); $stmt->bindParam(':guest', $guest); $stmt->bindParam(':icon', $icon); $stmt->bindParam(':iconurl', $iconurl); $stmt->bindParam(':window', $window); foreach ($buildArray as $t) : $name = $t['name']; $url = $t['url']; $defaultz = $t['defaultz']; $active = $t['active']; $user = $t['user']; $guest = $t['guest']; $icon = $t['icon']; $iconurl = $t['iconurl']; $window = $t['window']; $stmt->execute(); endforeach; endif; if($action == "addOptionz") : if($hasOptions == "Yes") : $file_db->exec("DELETE FROM options"); endif; if($hasOptions == "No") : $file_db->exec("CREATE TABLE options (title TEXT UNIQUE, topbar TEXT, bottombar TEXT, sidebar TEXT, hoverbg TEXT, topbartext TEXT, activetabBG TEXT, activetabicon TEXT, activetabtext TEXT, inactiveicon TEXT, inactivetext TEXT, loading TEXT, hovertext TEXT)"); endif; $title = $_POST['title']; $topbartext = $_POST['topbartext']; $topbar = $_POST['topbar']; $bottombar = $_POST['bottombar']; $sidebar = $_POST['sidebar']; $hoverbg = $_POST['hoverbg']; $hovertext = $_POST['hovertext']; $activetabBG = $_POST['activetabBG']; $activetabicon = $_POST['activetabicon']; $activetabtext = $_POST['activetabtext']; $inactiveicon = $_POST['inactiveicon']; $inactivetext = $_POST['inactivetext']; $loading = $_POST['loading']; $insert = "INSERT INTO options (title, topbartext, topbar, bottombar, sidebar, hoverbg, activetabBG, activetabicon, activetabtext, inactiveicon, inactivetext, loading, hovertext) VALUES (:title, :topbartext, :topbar, :bottombar, :sidebar, :hoverbg, :activetabBG, :activetabicon , :activetabtext , :inactiveicon, :inactivetext, :loading, :hovertext)"; $stmt = $file_db->prepare($insert); $stmt->bindParam(':title', $title); $stmt->bindParam(':topbartext', $topbartext); $stmt->bindParam(':topbar', $topbar); $stmt->bindParam(':bottombar', $bottombar); $stmt->bindParam(':sidebar', $sidebar); $stmt->bindParam(':hoverbg', $hoverbg); $stmt->bindParam(':activetabBG', $activetabBG); $stmt->bindParam(':activetabicon', $activetabicon); $stmt->bindParam(':activetabtext', $activetabtext); $stmt->bindParam(':inactiveicon', $inactiveicon); $stmt->bindParam(':inactivetext', $inactivetext); $stmt->bindParam(':loading', $loading); $stmt->bindParam(':hovertext', $hovertext); $stmt->execute(); endif; ?> Settings

translate("TABS");?>
" style="border-top-left-radius: 0; border-bottom-left-radius: 0;">
  • " value="">
    " value="">
    - translate("OR");?> -
    " value="">
    >
    >
    translate("ACTIVE");?>
    >
    translate("USER");?>
    >
    translate("GUEST");?>
    >
    translate("NO_IFRAME");?>
" autocorrect="off" autocapitalize="off" value="">
">
">
">

translate("LOGGED_IN"); $userActiveColor = "primary"; else : $userActive = $language->translate("LOGGED_OUT"); $userActiveColor = "danger"; endif; $userpic = md5( strtolower( trim( $row['email'] ) ) ); if(!empty($row["last"])) : $lastActive = date("Y-m-d H:i", intval($row["last"])); else : $lastActive = ""; endif; ?>
# translate("USERNAME");?> translate("EMAIL");?> translate("LOGIN_STATUS");?> translate("LAST_SEEN");?> translate("USER_GROUP");?> translate("USER_ACTIONS");?>
 
" autocorrect="off" autocapitalize="off" value="">
" value="">
" value="">
" value="">
" value="">
" value="">
> translate("MULTIPLE_LOGINS");?>
3
translate("GOOD_LOGINS");?> translate("BAD_LOGINS");?>
20%
80%
$val) : if($val["auth_type"] == "bad_auth") : $badLogin++; elseif($val["auth_type"] == "good_auth") : $goodLogin++; endif; ?>
translate("DATE");?> translate("USERNAME");?> translate("IP_ADDRESS");?> translate("TYPE");?>
">
translate("NOTHING_LOG"); endif; ?>

translate("ABOUT");?> Organizr

translate("SUBMIT_ISSUE");?> translate("VIEW_ON_GITHUB");?> translate("CHAT_WITH_US");?>

translate("DELETE_DATABASE");?>

translate("DELETE_WARNING");?>

translate("TITLE");?>

translate("TITLE");?>
translate("TITLE_TEXT");?>
translate("LOADING_COLOR");?>

translate("NAVIGATION_BARS");?>

translate("TOP_BAR");?>
translate("BOTTOM_BAR");?>
translate("SIDE_BAR");?>
translate("HOVER_BG");?>
translate("HOVER_TEXT");?>

translate("ACTIVE_TAB");?>

translate("ACTIVE_TAB_BG");?>
"">
translate("ACTIVE_TAB_ICON");?>
translate("ACTIVE_TAB_TEXT");?>

translate("INACTIVE_TAB");?>

translate("INACTIVE_ICON");?>
translate("INACTIVE_TEXT");?>
authenticated) : ?> authenticated) : ?>