"; 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 = $row['title']; $topbartext = $row['topbartext']; $topbar = $row['topbar']; $bottombar = $row['bottombar']; $sidebar = $row['sidebar']; $hoverbg = $row['hoverbg']; $activetabBG = $row['activetabBG']; $activetabicon = $row['activetabicon']; $activetabtext = $row['activetabtext']; $inactiveicon = $row['inactiveicon']; $inactivetext = $row['inactivetext']; $loading = $row['loading']; $hovertext = $row['hovertext']; endforeach; endif; $userpic = md5( strtolower( trim( $USER->email ) ) ); if(LOADINGICON !== "") : $loadingIcon = LOADINGICON; endif; endif; ?> <?=$title;?><?php if($title !== "Organizr") : echo " - Organizr"; endif; ?>
"; endif; ?>
authenticated && $tabSetup == "Yes" && $needSetup == "No") :?>

translate("OPTIONS");?>


authenticated) : ?>
user
username); ?>
role); ?>
authenticated && $configReady == "Yes") : ?> authenticated) : ?>