"; endforeach; } function write_ini_file($content, $path) { if (!$handle = fopen($path, 'w')) { return false; } $success = fwrite($handle, $content); fclose($handle); return $success; } function getTimezone(){ $regions = array( 'Africa' => DateTimeZone::AFRICA, 'America' => DateTimeZone::AMERICA, 'Antarctica' => DateTimeZone::ANTARCTICA, 'Asia' => DateTimeZone::ASIA, 'Atlantic' => DateTimeZone::ATLANTIC, 'Europe' => DateTimeZone::EUROPE, 'Indian' => DateTimeZone::INDIAN, 'Pacific' => DateTimeZone::PACIFIC ); $timezones = array(); foreach ($regions as $name => $mask) { $zones = DateTimeZone::listIdentifiers($mask); foreach($zones as $timezone) { $time = new DateTime(NULL, new DateTimeZone($timezone)); $ampm = $time->format('H') > 12 ? ' ('. $time->format('g:i a'). ')' : ''; $timezones[$name][$timezone] = substr($timezone, strlen($name) + 1) . ' - ' . $time->format('H:i') . $ampm; } } print ''; } if(isset($_POST['action'])) : $action = $_POST['action']; endif; if($action == "createLocation") : $databaseData = '; ' . "\r\n"; foreach ($_POST as $postName => $postValue) { if($postName !== "action") : if(substr($postValue, -1) == "/") : $postValue = rtrim($postValue, "/"); endif; $postValue = str_replace("\\","/", $postValue); $databaseData .= $postName . " = \"" . $postValue . "\"\r\n"; endif; } write_ini_file($databaseData, $databaseLocation); endif; if(!file_exists($databaseLocation)) : $configReady = "No"; $userpic = ""; else : $configReady = "Yes"; require_once("user.php"); $USER = new User("registration_callback"); $dbfile = DATABASE_LOCATION . constant('User::DATABASE_NAME') . ".db"; $database = new PDO("sqlite:" . $dbfile); $query = "SELECT * FROM users"; foreach($database->query($query) as $data) { $needSetup = "No"; } $db = DATABASE_LOCATION . constant('User::DATABASE_NAME') . ".db"; $file_db = new PDO("sqlite:" . $db); $file_db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $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"'); foreach($dbTab as $row) : if (in_array("tabs", $row)) : $tabSetup = "No"; endif; endforeach; if($tabSetup == "Yes") : $settingsActive = "active"; endif; foreach($dbOptions as $row) : if (in_array("options", $row)) : $hasOptions = "Yes"; endif; endforeach; if($tabSetup == "No") : if($USER->authenticated && $USER->role == "admin") : $result = $file_db->query('SELECT * FROM tabs WHERE active = "true"'); $getsettings = $file_db->query('SELECT * FROM tabs WHERE active = "true"'); foreach($getsettings as $row) : if(!empty($row['iconurl']) && $settingsicon == "No") : $settingsicon = "Yes"; endif; endforeach; elseif($USER->authenticated && $USER->role == "user") : $result = $file_db->query('SELECT * FROM tabs WHERE active = "true" AND user = "true"'); else : $result = $file_db->query('SELECT * FROM tabs WHERE active = "true" AND guest = "true"'); endif; endif; if($hasOptions == "Yes") : $resulto = $file_db->query('SELECT * FROM options'); foreach($resulto as $row) : $title = isset($row['title']) ? $row['title'] : "Organizr"; $topbartext = isset($row['topbartext']) ? $row['topbartext'] : "#66D9EF"; $topbar = isset($row['topbar']) ? $row['topbar'] : "#333333"; $bottombar = isset($row['bottombar']) ? $row['bottombar'] : "#333333"; $sidebar = isset($row['sidebar']) ? $row['sidebar'] : "#393939"; $hoverbg = isset($row['hoverbg']) ? $row['hoverbg'] : "#AD80FD"; $activetabBG = isset($row['activetabBG']) ? $row['activetabBG'] : "#F92671"; $activetabicon = isset($row['activetabicon']) ? $row['activetabicon'] : "#FFFFFF"; $activetabtext = isset($row['activetabtext']) ? $row['activetabtext'] : "#FFFFFF"; $inactiveicon = isset($row['inactiveicon']) ? $row['inactiveicon'] : "#66D9EF"; $inactivetext = isset($row['inactivetext']) ? $row['inactivetext'] : "#66D9EF"; $loading = isset($row['loading']) ? $row['loading'] : "#66D9EF"; $hovertext = isset($row['hovertext']) ? $row['hovertext'] : "#000000"; endforeach; endif; $userpic = md5( strtolower( trim( $USER->email ) ) ); if(LOADINGICON !== "") : $loadingIcon = LOADINGICON; endif; endif; ?>
Error: error; ?>