Example #1
0
 public function GetGpxContent()
 {
     $this->head .= "\n<script type=\"text/javascript\">var IE_LT_10 = false;</script><!--[if lt IE 10]>\n<script type=\"text/javascript\">IE_LT_10=true;</script>\n<![endif]-->";
     $this->head_js[] = '/include/js/login.js';
     $this->head_js[] = '/include/js/md5_sha.js';
     $this->head_js[] = '/include/thirdparty/js/jsSHA.js';
     $this->css_admin[] = '/include/css/login.css';
     $_POST += array('username' => '');
     $this->admin_js = true;
     \gp\tool\Session::cookie('g', 2);
     $this->BrowserWarning();
     $this->JavascriptWarning();
     echo '<div class="req_script nodisplay" id="login_container">';
     echo '<table><tr><td>';
     $cmd = \gp\tool::GetCommand();
     switch ($cmd) {
         case 'send_password':
             if ($this->SendPassword()) {
                 $this->LoginForm();
             } else {
                 $this->FogottenPassword();
             }
             break;
         case 'forgotten':
             $this->FogottenPassword();
             break;
         default:
             $this->LoginForm();
             break;
     }
     echo '</td></tr></table>';
     echo '</div>';
 }
Example #2
0
 /**
  * Make sure the current user stays logged in after a revert is completed
  *
  */
 public function TransferSession()
 {
     global $gpAdmin;
     $username = $gpAdmin['username'];
     // get user info
     $users = \gp\tool\Files::Get('_site/users');
     $userinfo =& $users[$username];
     $session_id = \gp\tool\Session::create($userinfo, $username, $sessions);
     if (!$session_id) {
         return;
     }
     //set the cookie for the new data
     $config = \gp\tool\Files::Get('_site/config');
     $session_cookie = 'gpEasy_' . substr(sha1($config['gpuniq']), 12, 12);
     \gp\tool\Session::cookie($session_cookie, $session_id);
     //set the update gpuniq value for the post_nonce
     $GLOBALS['config']['gpuniq'] = $config['gpuniq'];
 }