confirm.php
上传用户:gzy2002
上传日期:2010-02-11
资源大小:1785k
文件大小:3k
- <?php
- // +-------------------------------------------------------------+
- // | DeskPRO v [2.0.1 Production]
- // | Copyright (C) 2001 - 2004 Headstart Solutions Limited
- // | Supplied by WTN-WDYL
- // | Nullified by WTN-WDYL
- // | Distribution via WebForum, ForumRU and associated file dumps
- // +-------------------------------------------------------------+
- // | DESKPRO IS NOT FREE SOFTWARE
- // +-------------------------------------------------------------+
- // | License ID : Full Enterprise License =) ...
- // | License Owner : WTN-WDYL Team
- // +-------------------------------------------------------------+
- // | $RCSfile: confirm.php,v $
- // | $Date: 2004/02/11 20:32:12 $
- // | $Revision: 1.23 $
- // +-------------------------------------------------------------+
- // | File Details:
- // | - User validation handler
- // +-------------------------------------------------------------+
- error_reporting(E_ALL & ~E_NOTICE);
- require_once('./global.php');
- //Nullify WTN-WDYL Team
- $user_details = $db->query_return("
- SELECT * FROM user
- WHERE username = '" . mysql_escape_string($_REQUEST['username']) . "'
- AND validate_key = '" . mysql_escape_string($_REQUEST['key']) . "'
- AND awaiting_validation = 1
- ");
- if ($db->num_rows() > 0) {
- $db->query("
- UPDATE user
- SET awaiting_validation = 0
- WHERE username = '" . mysql_escape_string($_REQUEST['username']) . "'
- AND validate_key = '" . mysql_escape_string($_REQUEST['key']) . "'
- ");
- // update session
- $session = update_session('user', $user_details[id]);
- // so the email goes through
- unset($user_details['awaiting_validation']);
- // email the user
- $user_details = update_user_details($user_details);
- eval(makeemaileval('message', 'BODY_register_confirmed', $subject));
- dp_mail($user_details[email], $subject, $message);
- // we need to now process the user's tickets if they are not requiring tech validation as well
- if ($user['awaiting_manual_validation'] != 1) {
- new_db_class(2);
- $db->query("
- SELECT ticket.*, ticket_message.message, ticket_cat.name AS category_name, ticket_pri.name AS priority_name
- FROM ticket
- LEFT JOIN ticket_message ON (ticket.id = ticket_message.ticketid)
- LEFT JOIN ticket_cat ON (ticket_cat.id = ticket.category)
- LEFT JOIN ticket_pri ON (ticket_pri.id = ticket.priority)
- WHERE ticket.userid = '" . intval($user_details[id]) . "'
- AND (nodisplay = 2 OR nodisplay = 3)
- GROUP BY ticket.id
- ");
-
- while ($ticket = $db->row_array()) {
-
- // update ticket's display propery
- $db2->query("UPDATE ticket SET nodisplay = 0 WHERE id = '$ticket[id]'");
- // notify techs
- notify_technicians('new', $ticket, $user_details, $ticket[message]);
- }
- }
- jump("index.php", "redirect_registered");
- } else {
- error("error_no_registration");
- }