Esempio n. 1
0
 # temporary, non-exported variables
 $version = null;
 $strptime = null;
 $preview_pathspec = null;
 # verify integrity and config
 gb::verify();
 # authed?
 if (isset($_COOKIE['gb-chap']) && $_COOKIE['gb-chap']) {
     gb::authenticate(false);
     # now, gb::$authorized (a GBUser) is set (authed ok) or a CHAP
     # constant (not authed).
 }
 # transfer errors from ?gb-error to gb::$errors
 if (isset($_GET['gb-error']) && $_GET['gb-error']) {
     if (is_array($_GET['gb-error'])) {
         gb::$errors = array_merge(gb::$errors, $_GET['gb-error']);
     } else {
         gb::$errors[] = $_GET['gb-error'];
     }
 }
 # preview mode?
 if (isset($_GET[gb::$preview_query_key]) && gb::$authorized) {
     gb::$is_preview = true;
     $version = 'work';
 } elseif (isset($_GET[gb::$version_query_key]) && gb::$authorized) {
     gb::$is_preview = true;
     $version = $_GET[gb::$version_query_key];
 }
 if (gb::$is_preview === true && isset($_GET[gb::$pathspec_query_key])) {
     $preview_pathspec = $_GET[gb::$pathspec_query_key];
 }