]> andersk Git - sql-web.git/blobdiff - lib/security.lib.php
check quotas code
[sql-web.git] / lib / security.lib.php
index 7557465526cf66a96010402dc94cdc699efa461e..03121c4424b7a0cecc7cc05f6ffcc6a076a6c5c3 100644 (file)
@@ -236,8 +236,9 @@ function isImpersonating() {
 function impersonate($userId=null) {
        $wasImpersonating = isImpersonating();
        if ($wasImpersonating) {
-               if (is_null($userId)) {
+               if (is_null($userId) || empty($userId)) {
                        sess('UserId',sess('_UserId'));
+                       sess('_UserId','');
                } elseif ($userId>0) {
                        sess('UserId',$userId);
                } else {
@@ -280,6 +281,9 @@ function redirect($target=null,$secure=null) {
     $base = (is_null($target)||substr($target,0,1)=='?')?$_SERVER['REDIRECT_URL']:(dirname($_SERVER['REDIRECT_URL']).'/');
     redirectFull(is_null($target)?$base:($base.$target),$secure);
 }
+function redirectStart() {
+       redirectFull(BASE_URL,null);
+}
 function redirectFull($target,$secure) {
        redirect2((((isSSL()&&is_null($secure))||$secure==true)?'https://':'http://').$_SERVER['SERVER_NAME'].$target);
 }
This page took 0.147992 seconds and 4 git commands to generate.