/**
 * 
 * Function receive message
 * This function is used to handle how an error message is used
 * @param string $user_name = username the error relates to
 * @param string $type = user / Admin / system
 * @param string $level = how serious the problem is, or whether it is a sucess
 * @param string $subject = The title of the error problem (a preci effectively)
 * @param string $content = The error message in full.
 * @version 1.0
 * @author Patrick Lockley
 */
function receive_message($user_name, $type, $level, $subject, $content)
{
    global $xerte_toolkits_site;
    if ($level != "SUCCESS") {
        $_SESSION['toolkits_most_recent_error'] = $subject . " " . $content;
    }
    /*
     * If error log message turned on, create an error log
     */
    if (isset($xerte_toolkits_site->error_log_message) && $xerte_toolkits_site->error_log_message == "true") {
        write_message($user_name, $type, $level, $subject, $content);
    }
    /*
     * If error email message turned on, send an error email message 
     */
    if (isset($xerte_toolkits_site->error_email_message) && $xerte_toolkits_site->error_email_message == "true") {
        email_message($user_name, $type, $level, $subject, $content);
    }
}
Пример #2
0
function add_system_message($mes)
{
    if (empty($mes)) {
        return;
    }
    $sysmessage = array('postdate' => time(), 'poststatus' => 1, 'poster' => '', 'recipient' => '', 'text' => "<span class=\"sysmsg\">{$mes}</span>", 'delstatus' => 9);
    write_message($sysmessage);
}
Пример #3
0
            session_destroy();
            header("Location: " . $_SERVER['PHP_SELF']);
            break;
        case 'get_messages':
            echo get_messages($_SESSION['last_action']);
            die;
            break;
            /*case 'get_userlist':
              echo get_userlist();
              die;
              break;*/
    }
}
// message was sent, write to file
if ($_POST['msg'] && $_SESSION['auth'] == true) {
    write_message(microtime_float(), $_SESSION['name'], htmlspecialchars($_POST['msg']));
    die;
}
// check if login is valid
if ($_GET['name'] && $_GET['password'] && $_SESSION['auth'] != true) {
    $_SESSION['name'] = $_GET['name'];
    if ($_GET['password'] == PASSWORD) {
        $_SESSION['auth'] = true;
        $_SESSION['last_action'] = microtime_float();
        add_user($_SESSION['last_action'], $_SESSION['name']);
    } else {
        $msg = "<h3 class='error'>Fehler bei der Anmeldung!</h3>";
    }
}
/* 
 * functions