예제 #1
0
 private static function _get_voter_id()
 {
     if (!sys_is_guest($_SESSION["username"])) {
         return $_SESSION["username"];
     }
     return $_SESSION["ip"];
 }
예제 #2
0
	  <h1 class="pagetitle"><?php 
echo q($this->page["title"] ? $this->page["title"] : $this->page["name"]);
?>
</h1>
	  <div id="wikitext"><?php 
echo $this->cms->render($this->page["pagename"]);
?>
</div>
    </td>
  </tr></table>
  <div id="wikifoot">
    <div class="footnav">
	  <span style="float:right;">{t}Page last modified on{/t} <?php 
echo modify::localdateformat($this->page["lastmodified"], "{t}F j, Y{/t}");
?>
&nbsp;</span>
	  <?php 
if (!sys_is_guest($_SESSION["username"])) {
    ?>
<a href="?logout" accesskey="l">{t}Logout{/t}</a> - <?php 
}
?>
	  <a href="<?php 
echo SELF;
?>
/rss">{t}Recent changes{/t}</a> - 
	  <a href="?source">{t}Source{/t}</a>
	</div>
  </div>
</body>
</html>
예제 #3
0
 function output()
 {
     if ($this->pagename == "rss") {
         $this->_output_rss();
     }
     if ($this->pagename == "sitemap") {
         $this->_output_sitemap();
     }
     $this->template->cms = $this;
     $this->template->page = $this->page;
     $template = sys_custom("templates/cms/" . basename($this->page["template"]));
     if (!file_exists($template)) {
         $template = sys_custom("templates/cms/pmwiki.php");
     }
     $output = $this->template->render($template);
     echo $output;
     if (self::$cache_file != "" and $output != "" and $this->page["staticcache"] == "1" and sys_is_guest($_SESSION["username"]) and strpos($this->page["rread_users"], "|anonymous|") !== false) {
         sys_mkdir(dirname(self::$cache_file));
         file_put_contents(self::$cache_file, $output, LOCK_EX);
         if ($this->page["attachment"] == "") {
             return;
         }
         $files = explode("|", trim($this->page["attachment"], "|"));
         foreach ($files as $file) {
             copy($file, dirname(self::$cache_file) . "/" . modify::basename($file));
         }
     }
 }
예제 #4
0
function _login_session_destroy($id)
{
    if (APC_SESSION) {
        return apc_delete("sess" . $id);
    }
    if (sys_is_guest($_SESSION["username"]) or isset($_REQUEST["session_clean"])) {
        db_delete("simple_sys_session", array("id=@id@"), array("id" => $id));
    } else {
        db_update("simple_sys_session", array("expiry" => NOW - 10), array("id=@id@"), array("id" => $id));
    }
    return true;
}
예제 #5
0
 static function process_logout()
 {
     trigger::logout();
     if (!sys_is_guest($_SESSION["username"])) {
         sys_log_message_log("login", sprintf("{t}logout %s{/t}", $_SESSION["username"]));
     }
     session_destroy();
 }