当前位置: 首页>>代码示例>>PHP>>正文


PHP exitZP函数代码示例

本文整理汇总了PHP中exitZP函数的典型用法代码示例。如果您正苦于以下问题:PHP exitZP函数的具体用法?PHP exitZP怎么用?PHP exitZP使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了exitZP函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: load_request

 static function load_request($allow)
 {
     $uri = getRequestURI();
     $parts = explode('?', $uri);
     $uri = $parts[0];
     $path = ltrim(substr($uri, strlen(WEBPATH) + 1), '/');
     if (empty($path)) {
         return $allow;
     } else {
         $rest = strpos($path, '/');
         if ($rest === false) {
             if (strpos($path, '?') === 0) {
                 // only a parameter string
                 return $allow;
             }
             $l = $path;
         } else {
             $l = substr($path, 0, $rest);
         }
     }
     $locale = validateLocale($l, 'seo_locale');
     if ($locale) {
         // set the language cookie and redirect to the "base" url
         zp_setCookie('dynamic_locale', $locale);
         $uri = pathurlencode(preg_replace('|/' . $l . '[/$]|', '/', $uri));
         if (isset($parts[1])) {
             $uri .= '?' . $parts[1];
         }
         header("HTTP/1.0 302 Found");
         header("Status: 302 Found");
         header('Location: ' . $uri);
         exitZP();
     }
     return $allow;
 }
开发者ID:JoniWeiss,项目名称:JoniWebGirl,代码行数:35,代码来源:seo_locale.php

示例2: adminLoginAttempt

 static function adminLoginAttempt($success, $user, $pass, $athority)
 {
     if ($athority == 'zp_admin_auth' && $success) {
         header('Location: ' . FULLWEBPATH . '/' . ZENFOLDER . '/admin.php');
         exitZP();
     }
     return $success;
 }
开发者ID:ariep,项目名称:ZenPhoto20-DEV,代码行数:8,代码来源:show_not_logged-in.php

示例3: imageError

/**
 * If in debug mode, prints the given error message and continues; otherwise redirects
 * to the given error message image and exits; designed for a production gallery.
 * @param $errormessage string the error message to print if $_GET['debug'] is set.
 * @param $errorimg string the filename of the error image to display for production. Defaults
 *   to 'err-imagegeneral.png'. Images should be located in /zen/images .
 */
function imageError($status_text, $errormessage, $errorimg = 'err-imagegeneral.png')
{
    global $newfilename, $album, $image;
    $debug = isset($_GET['debug']);
    if ($debug) {
        echo '<strong>' . sprintf(gettext('Zenphoto Image Processing Error: %s'), $errormessage) . '</strong>' . '<br /><br />' . sprintf(gettext('Request URI: [ <code>%s</code> ]'), html_encode(getRequestURI())) . '<br />PHP_SELF: [ <code>' . html_encode($_SERVER['PHP_SELF']) . '</code> ]' . (empty($newfilename) ? '' : '<br />' . sprintf(gettext('Cache: [<code>%s</code>]'), '/' . CACHEFOLDER . '/' . html_encode(sanitize($newfilename, 3))) . ' ') . (empty($image) || empty($album) ? '' : ' <br />' . sprintf(gettext('Image: [<code>%s</code>]'), html_encode(sanitize($album . '/' . $image, 3))) . ' <br />');
    } else {
        if (DEBUG_IMAGE_ERR) {
            trigger_error($errormessage, E_USER_NOTICE);
        }
        header("HTTP/1.0 {$status_text}");
        header("Status: {$status_text}");
        header('Location: ' . FULLWEBPATH . '/' . ZENFOLDER . '/images/' . $errorimg);
    }
    exitZP();
}
开发者ID:rb26,项目名称:zenphoto,代码行数:23,代码来源:functions-image.php

示例4: imageError

/**
 * If in debug mode, prints the given error message and continues; otherwise redirects
 * to the given error message image and exits; designed for a production gallery.
 * @param $errormessage string the error message to print if $_GET['debug'] is set.
 * @param $errorimg string the filename of the error image to display for production. Defaults
 *   to 'err-imagegeneral.png'. Images should be located in /zen/images .
 */
function imageError($status_text, $errormessage, $errorimg = 'err-imagegeneral.png')
{
    global $newfilename, $album, $image;
    $debug = isset($_GET['debug']);
    $err = sprintf(gettext('Image Processing Error: %s'), $errormessage);
    if ($debug) {
        echo '<strong>' . $err . '</strong>';
    } else {
        if (DEBUG_IMAGE) {
            $msg = $err . "\n\t\t" . sprintf(gettext('Request URI: [%s]'), getRequestURI()) . "\n\t\t" . 'PHP_SELF: [' . sanitize($_SERVER['PHP_SELF'], 3) . ']';
            if ($newfilename) {
                $msg .= "\n\t\t" . sprintf(gettext('Cache: [%s]'), '/' . CACHEFOLDER . '/' . sanitize($newfilename, 3));
            }
            if ($image || $album) {
                $msg .= "\n\t\t" . sprintf(gettext('Image: [%s]'), sanitize($album . '/' . $image, 3));
            }
            debugLog($msg);
        }
        header("HTTP/1.0 {$status_text}");
        header("Status: {$status_text}");
        header('Location: ' . FULLWEBPATH . '/' . ZENFOLDER . '/images/' . $errorimg);
    }
    exitZP();
}
开发者ID:ariep,项目名称:ZenPhoto20-DEV,代码行数:31,代码来源:functions-image.php

示例5: startHTMLCache

 /**
  * Starts the caching: Gets either an already cached file if existing or starts the output buffering.
  *
  */
 function startHTMLCache()
 {
     global $_zp_gallery_page, $_zp_script_timer;
     if ($this->enabled && ($accessType = $this->checkIfAllowedPage())) {
         $_zp_script_timer['static cache start'] = microtime();
         $cachefilepath = $this->createCacheFilepath($accessType);
         if (!empty($cachefilepath)) {
             $cachefilepath = SERVERPATH . '/' . STATIC_CACHE_FOLDER . "/" . $cachefilepath;
             if (file_exists($cachefilepath)) {
                 $lastmodified = filemtime($cachefilepath);
                 // don't use cache if comment is posted or cache has expired
                 if (time() - $lastmodified < getOption("static_cache_expire")) {
                     //send the headers!
                     header('Content-Type: text/html; charset=' . LOCAL_CHARSET);
                     header("HTTP/1.0 200 OK");
                     header("Status: 200 OK");
                     header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $lastmodified) . ' GMT');
                     echo file_get_contents($cachefilepath);
                     // cache statistics
                     list($usec, $sec) = explode(' ', $_zp_script_timer['start']);
                     $start = (double) $usec + (double) $sec;
                     list($usec, $sec) = explode(' ', $_zp_script_timer['static cache start']);
                     $start_cache = (double) $usec + (double) $sec;
                     list($usec, $sec) = explode(' ', microtime());
                     $end = (double) $usec + (double) $sec;
                     echo "<!-- " . sprintf(gettext('Cached content of %3$s served by static_html_cache in %1$.4f seconds plus %2$.4f seconds unavoidable Zenphoto overhead.'), $end - $start_cache, $start_cache - $start, date('D, d M Y H:i:s', filemtime($cachefilepath))) . " -->\n";
                     exitZP();
                 }
             }
             $this->deletestatic_html_cacheFile($cachefilepath);
             if (ob_start()) {
                 $this->pageCachePath = $cachefilepath;
             }
         }
         unset($_zp_script_timer['static cache start']);
         // leave it out of the summary page
     }
 }
开发者ID:rb26,项目名称:zenphoto,代码行数:42,代码来源:static_html_cache.php

示例6: parse

 static function parse($success)
 {
     if (isset($_GET['p']) && isset($_GET['t'])) {
         //	zenphoto tiny url
         unset($_GET['t']);
         $tiny = sanitize_numeric($_GET['p']);
         $tbl = $tiny & 7;
         if (array_key_exists($tbl, self::$tableAsoc)) {
             $tbl = self::$tableAsoc[$tbl];
             $id = $tiny >> 3;
             $result = query_single_row('SELECT * FROM ' . prefix($tbl) . ' WHERE `id`=' . $id);
             if ($result) {
                 switch ($tbl) {
                     case 'news':
                     case 'pages':
                         $_GET['p'] = $tbl;
                         $_GET['title'] = $result['titlelink'];
                         break;
                     case 'news_categories':
                         $_GET['p'] = 'news';
                         $_GET['category'] = $result['titlelink'];
                         break;
                     case 'images':
                         $image = $_GET['image'] = $result['filename'];
                         $result = query_single_row('SELECT * FROM ' . prefix('albums') . ' WHERE `id`=' . $result['albumid']);
                     case 'albums':
                         $album = $_GET['album'] = $result['folder'];
                         unset($_GET['p']);
                         if (!empty($image)) {
                             $success = zp_load_image($album, $image);
                         } else {
                             if (!empty($album)) {
                                 $success = zp_load_album($album);
                             }
                         }
                         break;
                     case 'comments':
                         unset($_GET['p']);
                         $commentid = $id;
                         $type = $result['type'];
                         $result = query_single_row('SELECT * FROM ' . prefix($result['type']) . ' WHERE `id`=' . $result['ownerid']);
                         switch ($type) {
                             case 'images':
                                 $image = $result['filename'];
                                 $result = query_single_row('SELECT * FROM ' . prefix('albums') . ' WHERE `id`=' . $result['albumid']);
                                 $redirect = 'index.php?album=' . $result['folder'] . '&image=' . $image;
                                 break;
                             case 'albums':
                                 $album = $result['folder'];
                                 $redirect = 'index.php?album=' . $result['folder'];
                                 break;
                             case 'pages':
                                 $redirect = 'index.php?p=pages&title=' . $result['titlelink'];
                                 break;
                         }
                         $redirect .= '#zp_comment_id_' . $commentid;
                         header("HTTP/1.0 301 Moved Permanently");
                         header("Status: 301 Moved Permanently");
                         header('Location: ' . FULLWEBPATH . '/' . $redirect);
                         exitZP();
                         break;
                 }
             }
         }
     }
     return $success;
 }
开发者ID:ariep,项目名称:ZenPhoto20-DEV,代码行数:67,代码来源:tinyURL.php

示例7: reverify

 /**
  * Re-validates user's e-mail via ticket.
  * @param string $path the script (which we ignore)
  * @return string
  */
 static function reverify($path)
 {
     //process any verifications posted
     if (isset($_GET['user_expiry_reverify'])) {
         $params = unserialize(pack("H*", trim(sanitize($_GET['user_expiry_reverify']), '.')));
         if (time() - $params['date'] < 2592000) {
             $userobj = Zenphoto_Authority::getAnAdmin(array('`user`=' => $params['user'], '`email`=' => $params['email'], '`valid`>' => 0));
             if ($userobj) {
                 $credentials = $userobj->getCredentials();
                 $credentials[] = 'expiry';
                 $credentials[] = 'email';
                 $credentials = array_unique($credentials);
             }
             $userobj->setCredentials($credentials);
             $userobj->setValid(1);
             $userobj->set('loggedin', date('Y-m-d H:i:s'));
             $userobj->save();
             Zenphoto_Authority::logUser($userobj);
             header("Location: " . FULLWEBPATH . '/' . ZENFOLDER . '/admin.php');
             exitZP();
         }
     }
     if (user_expiry::checkPasswordRenew()) {
         header("Location: " . FULLWEBPATH . '/' . ZENFOLDER . '/admin-users.php?page=users&tab=users');
         exitZP();
     }
     return $path;
 }
开发者ID:Simounet,项目名称:zenphoto,代码行数:33,代码来源:user-expiry.php

示例8: reconfigureAction

/**
 *
 * Executes the configuration change code
 */
function reconfigureAction($mandatory)
{
    list($diff, $needs) = checkSignature($mandatory);
    $diffkeys = array_keys($diff);
    if ($mandatory) {
        if (isset($_GET['rss']) || isset($_GET['external'])) {
            if (isset($_GET['rss']) && file_exists(SERVERPATH . '/' . DATA_FOLDER . '/rss-closed.xml')) {
                $xml = file_get_contents(SERVERPATH . '/' . DATA_FOLDER . '/rss-closed.xml');
                $xml = preg_replace('~<pubDate>(.*)</pubDate>~', '<pubDate>' . date("r", time()) . '</pubDate>', $xml);
                echo $xml;
            }
            exit;
            //	can't really run setup from an RSS feed.
        }
        if (empty($needs)) {
            $dir = str_replace('\\', '/', dirname($_SERVER['SCRIPT_NAME']));
            $p = strpos($dir, ZENFOLDER);
            if ($p !== false) {
                $dir = substr($dir, 0, $p);
            }
            if (OFFSET_PATH) {
                $where = 'admin';
            } else {
                $where = 'gallery';
            }
            $dir = rtrim($dir, '/');
            $location = "http://" . $_SERVER['HTTP_HOST'] . $dir . "/" . ZENFOLDER . "/setup/index.php?autorun={$where}";
            header("Location: {$location}");
            exitZP();
        } else {
            global $subtabs, $zenphoto_tabs, $main_tab_space, $_zp_admin_tab, $_zp_invisible_execute, $_zp_gallery;
            $_zp_invisible_execute = 1;
            require_once SERVERPATH . '/' . ZENFOLDER . '/admin-globals.php';
            header('Last-Modified: ' . ZP_LAST_MODIFIED);
            header('Content-Type: text/html; charset=UTF-8');
            ?>
			<!DOCTYPE html>
			<html xmlns="http://www.w3.org/1999/xhtml">
				<head>
					<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
					<link rel="stylesheet" href="<?php 
            echo WEBPATH . '/' . ZENFOLDER;
            ?>
/admin.css" type="text/css" />
					<?php 
            reconfigureCS();
            ?>
				</head>
				<body>
					<?php 
            if ($_zp_gallery) {
                printLogoAndLinks();
            }
            ?>
					<div id="main">
						<?php 
            if ($_zp_gallery) {
                printTabs();
            }
            ?>
						<div id="content">
							<h1><?php 
            echo gettext('Setup request');
            ?>
</h1>
							<div class="tabbox">
								<?php 
            reconfigurePage($diff, $needs, $mandatory);
            ?>
							</div>
						</div>
					</div>
				</body>
			</html>
			<?php 
            exitZP();
        }
    } else {
        if (!empty($diff)) {
            if (function_exists('zp_register_filter') && zp_loggedin(ADMIN_RIGHTS)) {
                //	no point in telling someone who can't do anything about it
                zp_register_filter('admin_note', 'signatureChange');
                zp_register_filter('admin_head', 'reconfigureCS');
                zp_register_filter('theme_head', 'reconfigureCS');
                zp_register_filter('theme_body_open', 'signatureChange');
            }
        }
    }
}
开发者ID:ariep,项目名称:ZenPhoto20-DEV,代码行数:93,代码来源:reconfigure.php

示例9: XSRFdefender

/**
 * Checks for Cross Site Request Forgeries
 * @param string $action
 */
function XSRFdefender($action)
{
    $token = getXSRFToken($action);
    if (!isset($_REQUEST['XSRFToken']) || $_REQUEST['XSRFToken'] != $token) {
        zp_apply_filter('admin_XSRF_access', false, $action);
        header("HTTP/1.0 302 Found");
        header("Status: 302 Found");
        header('Location: ' . FULLWEBPATH . '/' . ZENFOLDER . '/admin.php?action=external&error&msg=' . sprintf(gettext('“%s” Cross Site Request Forgery blocked.'), $action));
        exitZP();
    }
    unset($_REQUEST['XSRFToken']);
    unset($_POST['XSRFToken']);
    unset($_GET['XSRFToken']);
}
开发者ID:ariep,项目名称:ZenPhoto20-DEV,代码行数:18,代码来源:admin-functions.php

示例10: pageError

 /**
  * Emits a page error. Used for attempts to bypass password protection
  *
  * @param string $err error code
  * @param string $text error message
  *
  */
 static function pageError($err, $text)
 {
     header("HTTP/1.0 " . $err . ' ' . $text);
     header("Status: " . $err . ' ' . $text);
     echo "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head>\t<title>" . $err . " - " . $text . "</TITLE>\t<META NAME=\"ROBOTS\" CONTENT=\"NOINDEX, FOLLOW\"></head>";
     echo "<BODY bgcolor=\"#ffffff\" text=\"#000000\" link=\"#0000ff\" vlink=\"#0000ff\" alink=\"#0000ff\">";
     echo "<FONT face=\"Helvitica,Arial,Sans-serif\" size=\"2\">";
     echo "<b>" . sprintf(gettext('Page error: %2$s (%1$s)'), $err, $text) . "</b><br /><br />";
     echo "</body></html>";
     exitZP();
 }
开发者ID:rb26,项目名称:zenphoto,代码行数:18,代码来源:downloadList.php

示例11: fix_path_redirect

/**
 * Checks to see if the current URL is a query string url when mod_rewrite is active.
 * If so it will redirects to the rewritten URL with a 301 Moved Permanently.
 */
function fix_path_redirect()
{
    if (MOD_REWRITE) {
        $request_uri = getRequestURI(false);
        $parts = parse_url($request_uri);
        $redirectURL = NULL;
        if (isset($parts['path'])) {
            // don't know how this can happen, but if it does, don't redirect
            if (isset($parts['query'])) {
                parse_str($parts['query'], $query);
                $redirectURL = zpRewriteURL($query);
            } else {
                $query = array();
            }
            if (isset($_GET['album'])) {
                if (isset($_GET['image'])) {
                    //image URLs should not end in a slash
                    if (substr($parts['path'], -1, 1) == '/') {
                        $redirectURL = zpRewriteURL($_GET);
                    }
                } else {
                    //album URLs should end in a slash for consistency
                    if (substr($parts['path'], -1, 1) != '/') {
                        $redirectURL = zpRewriteURL($_GET);
                    }
                }
            }
            if (isset($_GET['p'])) {
                switch ($_GET['p']) {
                    case 'news':
                        if (isset($_GET['title'])) {
                            //article URLs should not end in slash
                            if (substr($parts['path'], -1, 1) == '/') {
                                $redirectURL = zpRewriteURL($_GET);
                            }
                        } else {
                            //should be news/
                            if (substr($parts['path'], -1, 1) != '/') {
                                $redirectURL = zpRewriteURL($_GET);
                            }
                        }
                        break;
                    case 'search':
                        if (isset($_GET['date'])) {
                            if (substr($parts['path'], -1, 1) != '/') {
                                $redirectURL = zpRewriteURL($_GET);
                            }
                        }
                        break;
                }
            }
            //page numbers do not have trailing slash
            if (isset($_GET['page'])) {
                if (substr($parts['path'], -1, 1) == '/') {
                    $redirectURL = zpRewriteURL($_GET);
                }
            }
            if ($redirectURL) {
                $parts2 = parse_url($redirectURL);
                if (isset($parts2['query'])) {
                    parse_str($parts2['query'], $query2);
                } else {
                    $query2 = array();
                }
                if ($query != $query2 || preg_replace('~^' . WEBPATH . '/~', '', $parts['path']) != preg_replace('~^' . WEBPATH . '/~', '', html_encode($parts['path']))) {
                    header("HTTP/1.0 301 Moved Permanently");
                    header("Status: 301 Moved Permanently");
                    header('Location: ' . FULLWEBPATH . '/' . preg_replace('~^' . WEBPATH . '/~', '', $redirectURL));
                    exitZP();
                }
            }
        }
    }
}
开发者ID:ariep,项目名称:ZenPhoto20-DEV,代码行数:78,代码来源:functions-controller.php

示例12: setBase

 static function setBase()
 {
     setOption('cookieInvalidator_base', time());
     header('Location: ' . FULLWEBPATH . '/' . ZENFOLDER . '/admin.php');
     exitZP();
 }
开发者ID:benuri,项目名称:DevTools,代码行数:6,代码来源:cookieInvalidator.php

示例13: deleteZenpageObj

/**
 * Deletes an object from the database
 *
 */
function deleteZenpageObj($obj, $redirect = false)
{
    $result = $obj->remove();
    if ($result) {
        if ($redirect) {
            header('Location: ' . FULLWEBPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER . '/zenpage/' . $redirect . '?deleted');
            exitZP();
        }
        switch ($obj->table) {
            case 'pages':
                $msg = gettext("Page successfully deleted!");
                break;
            case 'news':
                $msg = gettext("Article successfully deleted!");
                break;
            case 'news_categories':
                $msg = gettext("Category successfully deleted!");
                break;
        }
        return "<p class='messagebox fade-message'>" . $msg . "</p>";
    }
    switch ($obj->table) {
        case 'pages':
            $msg = gettext("Page delete failed!");
            break;
        case 'news':
            $msg = gettext("Article delete failed!");
            break;
        case 'news_categories':
            $msg = gettext("Category  delete failed!");
            break;
    }
    return "<p class='errorbox fade-message'>" . $msg . "</p>";
}
开发者ID:ariep,项目名称:ZenPhoto20-DEV,代码行数:38,代码来源:admin-functions.php

示例14: comment_form_handle_comment


//.........这里部分代码省略.........
         */
        $_zp_HTML_cache->disable();
        if (in_context(ZP_IMAGE)) {
            $commentobject = $_zp_current_image;
            $redirectTo = $_zp_current_image->getLink();
        } else {
            if (in_context(ZP_ALBUM)) {
                $commentobject = $_zp_current_album;
                $redirectTo = $_zp_current_album->getLink();
            } else {
                if (in_context(ZP_ZENPAGE_NEWS_ARTICLE)) {
                    $commentobject = $_zp_current_article;
                    $redirectTo = FULLWEBPATH . '/index.php?p=news&title=' . $_zp_current_article->getTitlelink();
                } else {
                    if (in_context(ZP_ZENPAGE_PAGE)) {
                        $commentobject = $_zp_current_page;
                        $redirectTo = FULLWEBPATH . '/index.php?p=pages&title=' . $_zp_current_page->getTitlelink();
                    } else {
                        $commentobject = NULL;
                        $error = gettext('Comment posted on unknown page!');
                    }
                }
            }
        }
        if (is_object($commentobject)) {
            if (isset($_POST['name'])) {
                $p_name = sanitize($_POST['name'], 3);
            } else {
                $p_name = NULL;
            }
            if (isset($_POST['email'])) {
                $p_email = sanitize($_POST['email'], 3);
                if (!is_valid_email_zp($p_email)) {
                    $p_email = NULL;
                }
            } else {
                $p_email = NULL;
            }
            if (isset($_POST['website'])) {
                $p_website = sanitize($_POST['website'], 3);
                if ($p_website && strpos($p_website, 'http') !== 0) {
                    $p_website = 'http://' . $p_website;
                }
                if (!isValidURL($p_website)) {
                    $p_website = NULL;
                }
            } else {
                $p_website = NULL;
            }
            if (isset($_POST['comment'])) {
                $p_comment = sanitize($_POST['comment'], 1);
            } else {
                $p_comment = '';
            }
            $p_server = getUserIP();
            if (isset($_POST['code'])) {
                $code1 = sanitize($_POST['code'], 3);
                $code2 = sanitize($_POST['code_h'], 3);
            } else {
                $code1 = '';
                $code2 = '';
            }
            $p_private = isset($_POST['private']);
            $p_anon = isset($_POST['anon']);
            $commentadded = $commentobject->addComment($p_name, $p_email, $p_website, $p_comment, $code1, $code2, $p_server, $p_private, $p_anon, serialize(getCommentAddress(0)));
            $comment_error = $commentadded->getInModeration();
            $_zp_comment_stored = array('name' => $commentadded->getName(), 'email' => $commentadded->getEmail(), 'website' => $commentadded->getWebsite(), 'comment' => $commentadded->getComment(), 'saved' => isset($_POST['remember']), 'private' => $commentadded->getPrivate(), 'anon' => $commentadded->getAnon(), 'custom' => $commentadded->getCustomData());
            if ($comment_error) {
                $error = $commentadded->comment_error_text;
                $comment_error++;
            } else {
                $_zp_HTML_cache->clearHtmlCache();
                $error = NULL;
                if (isset($_POST['remember'])) {
                    // Should always re-cookie to update info in case it's changed...
                    $_zp_comment_stored['comment'] = '';
                    // clear the comment itself
                    zp_setCookie('zenphoto_comment', serialize($_zp_comment_stored));
                } else {
                    zp_clearCookie('zenphoto_comment');
                }
                //use $redirectTo to send users back to where they came from instead of booting them back to the gallery index. (default behaviour)
                if (!isset($_SERVER['SERVER_SOFTWARE']) || strpos(strtolower($_SERVER['SERVER_SOFTWARE']), 'microsoft-iis') === false) {
                    // but not for Microsoft IIS because that server fails if we redirect!
                    header('Location: ' . $redirectTo . '#zp_comment_id_' . $commentadded->getId());
                    exitZP();
                }
            }
        }
        return $error;
    } else {
        if (!empty($cookie)) {
            $cookiedata = getSerializedArray($cookie);
            if (count($cookiedata) > 1) {
                $_zp_comment_stored = $cookiedata;
            }
        }
    }
    return false;
}
开发者ID:ariep,项目名称:ZenPhoto20-DEV,代码行数:101,代码来源:functions.php

示例15: handleLogon

 /**
  * User authentication support
  */
 function handleLogon()
 {
     global $_zp_current_admin_obj, $_zp_login_error, $_zp_captcha, $_zp_loggedin;
     if (isset($_POST['login'])) {
         $post_user = sanitize(@$_POST['user'], 0);
         $post_pass = sanitize(@$_POST['pass'], 0);
         $_zp_loggedin = false;
         switch (@$_POST['password']) {
             default:
                 $user = self::checkLogon($post_user, $post_pass);
                 if ($user) {
                     $_zp_loggedin = $user->getRights();
                 }
                 $_zp_loggedin = zp_apply_filter('admin_login_attempt', $_zp_loggedin, $post_user, $post_pass);
                 if ($_zp_loggedin) {
                     self::logUser($user);
                     $_zp_current_admin_obj = $user;
                     session_regenerate_id(true);
                 } else {
                     zp_clearCookie("zp_user_auth");
                     // Clear the cookie, just in case
                     $_zp_login_error = 1;
                 }
                 break;
             case 'challenge':
                 $user = $this->getAnAdmin(array('`user`=' => $post_user, '`valid`=' => 1));
                 if (is_object($user)) {
                     $info = $user->getChallengePhraseInfo();
                     if ($post_pass && $info['response'] == $post_pass) {
                         $ref = self::getResetTicket($post_user, $user->getPass());
                         header('location:' . WEBPATH . '/' . ZENFOLDER . '/admin-users.php?ticket=' . $ref . '&user=' . $post_user);
                         exitZP();
                     }
                 }
                 $_zp_login_error = gettext('Sorry, that is not the answer.');
                 $_REQUEST['logon_step'] = 'challenge';
                 break;
             case 'captcha':
                 if ($_zp_captcha->checkCaptcha(trim(@$_POST['code']), sanitize(@$_POST['code_h'], 3))) {
                     require_once dirname(__FILE__) . '/load_objectClasses.php';
                     // be sure that the plugins are loaded for the mail handler
                     if (empty($post_user)) {
                         $requestor = gettext('You are receiving this e-mail because of a password reset request on your ZenPhoto20 gallery.');
                     } else {
                         $requestor = sprintf(gettext("You are receiving this e-mail because of a password reset request on your ZenPhoto20 gallery from a user who tried to log in as %s."), $post_user);
                     }
                     $admins = $this->getAdministrators();
                     $mails = array();
                     $user = NULL;
                     foreach ($admins as $key => $tuser) {
                         if (!empty($tuser['email'])) {
                             if (!empty($post_user) && ($tuser['user'] == $post_user || $tuser['email'] == $post_user)) {
                                 $name = $tuser['name'];
                                 if (empty($name)) {
                                     $name = $tuser['user'];
                                 }
                                 $mails[$name] = $tuser['email'];
                                 $user = $tuser;
                                 unset($admins[$key]);
                                 // drop him from alternate list.
                             } else {
                                 if (!($tuser['rights'] & ADMIN_RIGHTS)) {
                                     unset($admins[$key]);
                                     // eliminate any peons from the list
                                 }
                             }
                         } else {
                             unset($admins[$key]);
                             // we want to ignore groups and users with no email address here!
                         }
                     }
                     $cclist = array();
                     foreach ($admins as $tuser) {
                         $name = $tuser['name'];
                         if (empty($name)) {
                             $name = $tuser['user'];
                         }
                         if (is_null($user)) {
                             $user = $tuser;
                             $mails[$name] = $tuser['email'];
                         } else {
                             $cclist[$name] = $tuser['email'];
                         }
                     }
                     if (is_null($user)) {
                         $_zp_login_error = gettext('There was no one to which to send the reset request.');
                     } else {
                         $ref = self::getResetTicket($user['user'], $user['pass']);
                         $msg = "\n" . $requestor . "\n" . sprintf(gettext("To reset your Admin passwords visit: %s"), FULLWEBPATH . "/" . ZENFOLDER . "/admin-users.php?ticket={$ref}&user=" . $user['user']) . "\n" . gettext("If you do not wish to reset your passwords just ignore this message. This ticket will automatically expire in 3 days.");
                         $err_msg = zp_mail(gettext("The ZenPhoto20 information you requested"), $msg, $mails, $cclist);
                         if (empty($err_msg)) {
                             $_zp_login_error = 2;
                         } else {
                             $_zp_login_error = $err_msg;
                         }
                     }
                 } else {
//.........这里部分代码省略.........
开发者ID:ariep,项目名称:ZenPhoto20-DEV,代码行数:101,代码来源:lib-auth.php


注:本文中的exitZP函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。