Ejemplo n.º 1
0
        $dataclass->save();
        # Give the user a status message
        $statusmessage = "User "{$adduserkey}" edited";
        if ($passchange == "y") {
            $statusmessage = "User "{$adduserkey}" edited - password changed";
        }
    }
}
if ($_GET[edit] && !$_POST[edituser] && !$_GET[action]) {
    #
    #	Edit a user
    #
    $now = time();
    $dataclass = new SettingsStorage('settings');
    $currentusers = $dataclass->settings['users'];
    $usertoedit = urlTitle($_GET[edit]);
    if (array_key_exists($usertoedit, $currentusers)) {
        $userkey = $usertoedit;
        $usertoedit = $currentusers[$userkey];
        $main_content = '
	<div id="manage_users_wrapper">
		<div class="div_normal">
			<fieldset>
				<legend>' . i18n("generic_edit") . ' <u>' . $userkey . '</u> (' . $usertoedit[nickname] . ')</legend>
				
			<form id="edit_user_form" class="cpform" method="post">
			<input type="hidden" name="panel" value="users" />
			<input type="hidden" name="edituser[name]" value="' . $userkey . '" />
			<p><select name="edituser[level]">';
        if ($usertoedit[level] == 4) {
            $main_content .= ' <option value="4" selected="selected">Admin</option>';
Ejemplo n.º 2
0
<?php

$moduletitle = "Help, Support and Credits";
include KNIFE_PATH . '/documentation.php';
$main_content .= '<h2 id="toc">Table of contents</h2><ul>';
foreach ($documentation as $null => $data) {
    $main_content .= "<li><a href=\"#" . urltitle($data[title]) . "\">{$data['title']}</a></li>";
}
$main_content .= '</ul>';
foreach ($documentation as $null => $data) {
    $main_content .= "<h3 id=\"" . urlTitle($data[title]) . "\">{$data['title']} ^ <small><a href=\"#toc\">back</a></small></h3>";
    $main_content .= '<div>' . $data[content] . '</div>';
}
$main_content .= '
	<h2>Credits</h2>
	<p><strong>Icons</strong>: <a href="http://zeus.qballcow.nl/icon/">Gartoon</a> by Zeus</p>
	<p>Language credit (autogenerated from the files)</p>
	<p>Development credit</p>

	';
<?php

#
#		File loaded when displaying a single article
#
include_once KNIFE_PATH . '/plugins/kses.php';
$UserDB->verify("HeadersSent");
$k = $_GET[k];
if (!$k) {
    $k = $AADB->urldeconstructor($pathinfo_array, "title");
}
if (eregi("[a-z]", $k)) {
    # if $k is alpha , find the timestamp for this article
    foreach ($allarticles as $timestamp => $article) {
        if (urlTitle($article[title]) == $k) {
            $k = $timestamp;
            print_r($next);
            break 1;
        }
    }
}
# FIXME: The following seems a bit inappropriate - resource-hog: Have a variable and reconstructing it...
unset($allarticles);
$article = $AADB->getarticle($k);
# FIXME: Is this needed?
#if (!$article) {
#	$article = $allarticles[$k];
#	}
if (is_array($article) and $article != "") {
    $valid = true;
} else {
 function urlconstructor($article, $categories)
 {
     global $config_urlstyle;
     unset($config_urlstyle[0]);
     $constructor = $config_urlstyle;
     # get the keys
     $titlekey = array_search("title", $config_urlstyle);
     $catkey = array_search("category", $config_urlstyle);
     # right, now populate the array
     $constructor[$titlekey] = urlTitle($article[title]);
     if ($catkey) {
         $constructor[$catkey] = urlTitle(implode("_", $categories));
     }
     $return = implode("/", $constructor);
     return $return;
 }
Ejemplo n.º 5
0
 function verify()
 {
     $userdata = KUsers::collectlogin();
     if (!$userdata) {
         return false;
     }
     $users = KUsers::getusers();
     $unique = UNIQUE;
     $return = false;
     # $unique_password = $userdata[ . $unique;
     if ($userdata[logintype] == "standard") {
         $e_md5 = md5($userdata[password]);
         $e_given = sha1($e_md5 . $unique);
     } elseif ($userdata[logintype] == "comment") {
         $e_md5 = md5($userdata[password]);
         $e_given = sha1($e_md5 . $unique);
     } else {
         $e_given = sha1($userdata[password] . $unique);
     }
     foreach ($users as $thisuser => $thisuserdata) {
         if (urlTitle($userdata[username]) == urlTitle($thisuser)) {
             if ($e_given == $thisuserdata[password]) {
                 $this->username = $thisuser;
                 $this->nickname = $thisuserdata[nickname];
                 $this->status = "verified";
                 $this->level = $thisuserdata[level];
                 $this->language = $userdata[language];
                 $this->type = $userdata[logintype];
                 if ($userdata[logintype] == "standard") {
                     setcookie("kusername", $thisuser, time() + 3600);
                     setcookie("kmd5password", $e_md5, time() + 3600);
                     setcookie("klanguage", $userdata[language]);
                 }
             }
         }
     }
 }
Ejemplo n.º 6
0
 function verify($SentHeaders = false)
 {
     global $Settings;
     $userdata = KUsers::collectlogin();
     if (!$userdata) {
         return false;
     }
     $users = KUsers::getusers();
     $unique = $Settings->unique;
     $return = false;
     if ($userdata[logintype] == "standard") {
         $e_md5 = md5($userdata[password]);
         $e_given = sha1($e_md5 . $unique);
     } elseif ($userdata[logintype] == "comment") {
         $e_md5 = md5($userdata[password]);
         $e_given = sha1($e_md5 . $unique);
     } else {
         $e_given = sha1($userdata[password] . $unique);
     }
     foreach ($users as $thisuser => $thisuserdata) {
         if (urlTitle($userdata[username]) == urlTitle($thisuser)) {
             if ($e_given == $thisuserdata[password]) {
                 $this->username = $thisuser;
                 $this->nickname = $thisuserdata[nickname];
                 $this->url = $thisuserdata[url];
                 $this->email = $thisuserdata[email];
                 $this->status = "verified";
                 $this->level = $thisuserdata[level];
                 $this->language = $userdata[language];
                 $this->type = $userdata[logintype];
                 if ($userdata[logintype] == "standard") {
                     if (!$SentHeaders) {
                         setcookie("allegory_username", $thisuser, time() + 14400, "/");
                         setcookie("allegory_md5password", $e_md5, time() + 14400, "/");
                         setcookie("allegory_language", $userdata[language], time() + 100000, "/");
                     } else {
                         # Set the cookies via echoing a javascript here.
                         # Will probably also need a JS refresh ( FIXME )
                         echo "<script type=\"text/javascript\">\n\t\t\t\t\t\tvar now = new Date();\n\t\t\t\t\t\tnow.setTime(now.getTime() + 365 * 24 * 60 * 60 * 1000);\n\t\t\t\t\t\tAllegory_Setcookie(\"allegory_username\", \"{$thisuser}\", now, \"/\");\n\t\t\t\t\t\tAllegory_Setcookie(\"allegory_md5password\", \"{$e_md5}\", now, \"/\");\n\t\t\t\t\t\t</script>";
                     }
                 }
             }
         }
     }
 }