function CheckKey()
{
    global $user, $DB, $Account;
    if (isset($_GET['key'])) {
        if (isset($_GET['id'])) {
            $lock = $DB->selectCell("SELECT `locked` FROM account WHERE id='" . $_GET['id'] . "'");
            if ($user['id'] > 0 && $lock == 0) {
                output_message('info', 'Your account is already active!');
            } else {
                $check_key = $Account->isValidActivationKey($_GET['key']);
                if ($check_key != FALSE) {
                    if ($_GET['id'] == $check_key) {
                        $DB->query("UPDATE account SET locked=0 WHERE id='" . $_GET['id'] . "' LIMIT 1");
                        $DB->query("UPDATE account_extend SET activation_code=NULL WHERE account_id='" . $_GET['id'] . "' LIMIT 1");
                        output_message('success', '<b>Account successfully activated! You may now log into the server and play.</b>');
                    } else {
                        output_message('error', 'This Activation Key does not belong to this account id!');
                    }
                } else {
                    output_message('error', 'Not a valid activation key.');
                }
            }
        }
    }
}
function addLink()
{
    global $DB, $Core, $lang;
    $DB->query("INSERT INTO mw_menu_items(\r\n\t\t`menu_id`,\r\n\t\t`link_title`,\r\n\t\t`link`,\r\n\t\t`guest_only`,\r\n\t\t`account_level`)\r\n\t  VALUES(\r\n\t\t'" . $_POST['menu_id'] . "', \r\n\t\t'" . $_POST['link_title'] . "', \r\n\t\t'" . $_POST['link'] . "', \r\n\t\t'" . $_POST['guest_only'] . "', \r\n\t\t'" . $_POST['account_level'] . "')\r\n\t");
    $Core->clearCache();
    output_message('success', $lang['link_add_success']);
}
Example #3
0
function databaseErrorHandler($message, $info)
{
    if (!error_reporting()) {
        return;
    }
    output_message('alert', "SQL Error: {$message}<br><pre>" . print_r($info, true) . "</pre>");
}
function delNews($idzz)
{
    global $DB, $Core;
    $DB->query("DELETE FROM `mw_news` WHERE `id`='{$idzz}'");
    $Core->clearCache();
    output_message('success', 'Deleted News Item.');
}
Example #5
0
function addFaq()
{
    global $DB, $Core, $lang;
    $DB->query("INSERT INTO mw_faq(\r\n\t\t`question`,\r\n\t\t`answer`)\r\n\t  VALUES(\r\n\t\t'" . $_POST['question'] . "',  \r\n\t\t'" . $_POST['answer'] . "'\r\n\t\t)\r\n\t");
    $Core->clearCache();
    output_message('success', $lang['faq_add_success']);
}
function changeName()
{
    global $Config, $DB, $lang, $user;
    include 'core/SDL/class.character.php';
    $Character = new Character();
    if (empty($_POST['newname'])) {
        output_message('error', $lang['char_rename_newname']);
        return FALSE;
    }
    if ($Config->get('module_charrename') == 0) {
        output_message('error', 'Nice try hacking, but not good enough.');
        return FALSE;
    }
    if ($user['web_points'] >= $Config->get('module_charrename_pts')) {
        if ($Character->checkNameExists($_POST['newname']) == FALSE) {
            if ($Character->isOnline($_POST['id']) == FALSE) {
                if ($Character->setName($_POST['id'], $_POST['newname']) == TRUE) {
                    $DB->query("UPDATE `mw_account_extend` SET \n\t\t\t\t\t\t`web_points`=(`web_points` - " . $Config->get('module_charrename_pts') . "), \n\t\t\t\t\t\t`points_spent`=(`points_spent` + " . $Config->get('module_charrename_pts') . ")  \n\t\t\t\t\t   WHERE `account_id` = " . $user['id'] . " LIMIT 1");
                    output_message('success', $lang['char_rename_success'] . ' Redirecting...<meta http-equiv=refresh content="3;url=?p=account&sub=rename">');
                }
            } else {
                output_message('validation', $lang['char_is_online']);
            }
        } else {
            output_message('validation', $lang['char_name_exists']);
        }
    } else {
        output_message('validation', $lang['not_enough_points']);
    }
}
function process()
{
    global $lang, $DB, $Account;
    if ($_POST['retr_login'] && $_POST['retr_email'] && $_POST['secretq1'] && $_POST['secretq2'] && $_POST['secreta1'] && $_POST['secreta2']) {
        //set return as true - we will make false if something is wrong
        $return = TRUE;
        /*Check 1*/
        $username = strip_if_magic_quotes($_POST['retr_login']);
        if (check_for_symbols($username, 1) == TRUE) {
            $return = FALSE;
        } else {
            if ($DB->selectRow("SELECT * FROM `account` WHERE username='******'") == false) {
                $username == FALSE;
                $return = FALSE;
            } else {
                $d = $DB->selectRow("SELECT * FROM `account` WHERE username='******'");
                $username =& $d['id'];
                $username_name =& $d['username'];
                $email =& $d['email'];
                $posted_email =& $_POST['retr_email'];
                /*Check 2*/
                if ($email != $posted_email) {
                    $return = FALSE;
                }
            }
        }
        $secreta1 =& $_POST['secreta1'];
        $secreta2 =& $_POST['secreta2'];
        /*Check 3*/
        if (check_for_symbols($_POST['secreta1']) || check_for_symbols($_POST['secreta2'])) {
            $return = FALSE;
        }
        if ($return == FALSE) {
            output_message('error', $lang['restore_pass_fail'] . '<meta http-equiv=refresh content="3;url=index.php?p=account&sub=restore">');
        } elseif ($return == TRUE) {
            $rp_sq1 = strip_if_magic_quotes($_POST['secretq1']);
            $rp_sq2 = strip_if_magic_quotes($_POST['secretq2']);
            $rp_sa1 = strip_if_magic_quotes($_POST['secreta1']);
            $rp_sa2 = strip_if_magic_quotes($_POST['secreta2']);
            $we = $DB->selectRow("SELECT account_id FROM `mw_account_extend` WHERE account_id='" . $username . "' AND secret_q1='" . $rp_sq1 . "' AND secret_q2='" . $rp_sq2 . "' AND secret_a1='" . $rp_sa1 . "' AND secret_a2='" . $rp_sa2 . "'");
            if ($we !== FALSE) {
                $pas = random_string(7);
                $c_pas = $Account->sha_password($username_name, $pas);
                $DB->query("UPDATE `account` SET sha_pass_hash='" . $c_pas . "' WHERE id='" . $username . "'");
                $DB->query("UPDATE `account` SET sessionkey=NULL WHERE id='" . $username . "'");
                output_message('success', $lang['restore_pass_success'] . '<br /> New password: '******'error', $lang['restore_pass_fail'] . '<meta http-equiv=refresh content="3;url=index.php?n=account&sub=restore">');
            }
        }
    } else {
        output_message('error', $lang['restore_pass_fail'] . '<meta http-equiv=refresh content="3;url=index.php?p=account&sub=restore">');
        echo "<br />";
    }
}
function clearLogFile()
{
    global $lang;
    $handle = fopen('core/logs/error_log.txt', 'w+');
    if ($handle) {
        fclose($handle);
        output_message('success', $lang['error_log_cleared'] . '<meta http-equiv=refresh content="3;url=?p=admin&sub=errorlog">');
    } else {
        output_message('error', 'Unable to open the errorlog!');
    }
}
Example #9
0
 public function index()
 {
     output_message('success', 'testing');
     output_message('warning', 'testing');
     output_message('error', 'testing');
     output_message('info', 'testing');
     // Get news posts
     $data['news'] = $this->news->get_news_posts();
     // Load the page, and we are done :)
     $this->load->view('index', $data);
 }
function saveConfig()
{
    global $Config, $lang;
    foreach ($_POST as $item => $val) {
        $key = explode('__', $item);
        if ($key[0] == 'cfg') {
            $Config->set($key[1], $val);
        }
    }
    $Config->Save();
    output_message('success', $lang['cache_settings_saved'] . '<meta http-equiv=refresh content="3;url=?p=admin&sub=cache">');
}
Example #11
0
 public static function log_action($action, $message = "")
 {
     $path_to_logs = SITE_ROOT . DS . 'logs';
     $log = $path_to_logs . DS . "log.txt";
     $new = file_exists($log) ? false : true;
     if ($handle = fopen($log, 'a')) {
         $timestamp = strftime("%Y-%m-%d %H:%M:%S", time());
         $content = "{$timestamp} | {$action}: {$message}\n";
         fwrite($handle, $content);
         fclose($handle);
         if ($new) {
             chmod($log, 0755);
         }
     } else {
         output_message("Log file is not writable.");
     }
 }
function confirmPayment()
{
    global $DB, $user, $lang;
    $pay = $DB->selectRow("SELECT * FROM `mw_donate_transactions` WHERE `account`='" . $user['id'] . "' AND `item_given`='0' LIMIT 1");
    if ($pay == FALSE) {
        output_message('validation', $lang['donate_no_trans']);
        echo '<br /><br /><center><b><u>Redirecting...</u></b></center> <meta http-equiv=refresh content="8;url=?p=donate">';
    } else {
        if ($pay['payment_status'] == 'Completed') {
            $item = $DB->selectRow("SELECT * FROM `mw_donate_packages` WHERE `id`='" . $pay['item_number'] . "'");
            if ($item['cost'] > $pay['amount']) {
                output_message('error', $lang['donate_not_face_value']);
            } else {
                $DB->query("UPDATE `mw_donate_transactions` SET `item_given`='1' WHERE `account`='" . $user['id'] . "' AND `id`='" . $pay['id'] . "' LIMIT 1");
                $DB->query("UPDATE `mw_account_extend` SET \r\n\t\t\t\t\t`web_points` = (`web_points` + " . $item['points'] . "),\r\n\t\t\t\t\t`points_earned` = (`points_earned` + " . $item['points'] . "),\r\n\t\t\t\t\t`total_donations` = (`total_donations` + " . $pay['amount'] . ")\r\n\t\t\t\t  WHERE `account_id`='" . $user['id'] . "'");
                output_message('success', $lang['donate_points_given']);
            }
        } else {
            output_message('warning', $lang['donate_status_not_complete']);
        }
    }
}
function reCustomize()
{
    global $Config, $DB, $lang, $user;
    include 'core/SDL/class.character.php';
    $Character = new Character();
    if ($Config->get('module_charcustomize') == 0) {
        output_message('error', 'Nice try hacking, but not good enough.');
        return FALSE;
    }
    // Check to see the user has enough points
    if ($user['web_points'] >= $Config->get('module_charcustomize_pts')) {
        if ($Character->setCustomize($_POST['id']) == TRUE) {
            $DB->query("UPDATE `mw_account_extend` SET \n\t\t\t\t`web_points`=(`web_points` - " . $Config->get('module_charcustomize_pts') . "), \n\t\t\t\t`points_spent`=(`points_spent` + " . $Config->get('module_charcustomize_pts') . ")  \n\t\t\t   WHERE `account_id` = " . $user['id'] . " LIMIT 1");
            output_message('success', $lang['char_recustomize_success']);
            echo "<br /><br />";
        } else {
            output_message('warning', $lang['char_recustomize_already_set']);
            echo "<br /><br />";
        }
    } else {
        output_message('validation', $lang['not_enough_points']);
    }
}
function saveConfig()
{
    global $lang;
    $conffile = "config/config-protected.php";
    $build = '';
    $build .= "<?php\n";
    $build .= "\$db = array(\n";
    $build .= "'db_host'         => '" . $_POST['db_host'] . "',\n";
    $build .= "'db_port'         => '" . $_POST['db_port'] . "',\n";
    $build .= "'db_username'     => '" . $_POST['db_username'] . "',\n";
    $build .= "'db_password'     => '" . $_POST['db_password'] . "',\n";
    $build .= "'db_name'         => '" . $_POST['db_name'] . "',\n";
    $build .= "'db_encoding'     => 'utf8',\n";
    $build .= ");\n";
    $build .= "?>";
    if (is_writeable($conffile)) {
        $openconf = fopen($conffile, 'w+');
        fwrite($openconf, $build);
        fclose($openconf);
        output_message('success', $lang['config_updated_successfully']);
    } else {
        output_message('error', 'Couldn\'t open main-config.php for editing, it must be writable by webserver! <br /><a href="javascript: history.go(-1)">Go back, and try again.</a>');
    }
}
Example #15
0
<?php

if (!isset($_SESSION['user_id'])) {
    redirect_to(SITE_URL . DS . 'login' . DS);
}
require_once INCLUDES . DS . 'header.inc.php';
?>

<div id="content">
<?php 
echo output_message($session->message);
?>
<h2>contexts<br />
<span>@<?php 
echo stripslashes($page3);
?>
</h2>

	<ul id="items">
	<?php 
$mit = new Task();
?>
		<?php 
$i = 1;
foreach ($contexts as $context) {
    $mit = Task::find_by_id($context->task_id);
    if ($mit->archived != 1) {
        ?>
		<li class="<?php 
        if ($mit->completed == 1) {
            echo 'dull';
Example #16
0
        if (isset($_POST['profile']['g_id'])) {
            unset($_POST['profile']['g_id']);
        }
        $_POST['profile']['signature'] = htmlspecialchars($_POST['profile']['signature']);
        $DB->query("UPDATE account_extend SET ?a WHERE account_id=?d LIMIT 1", RemoveXSS($_POST['profile']), $user['id']);
        redirect('index.php?n=account&sub=manage', 1);
    } elseif ($_GET['action'] == 'changesecretq') {
        if (check_for_symbols($_POST['secreta1']) == FALSE && check_for_symbols($_POST['secreta2']) == FALSE && $_POST[secretq1] != '0' && $_POST[secretq2] != '0' && isset($_POST[secreta1]) && isset($_POST[secreta2]) && strlen($_POST[secreta1]) > 4 && strlen($_POST[secreta2]) > 4 && $_POST['secreta1'] != $_POST['secreta2'] && $_POST['secretq1'] != $_POST['secretq2']) {
            $DB->query("UPDATE account_extend SET secretq1=?,secretq2=?,secreta1=?,secreta2=? WHERE account_id=?d", strip_if_magic_quotes($_POST['secretq1']), strip_if_magic_quotes($_POST['secretq2']), strip_if_magic_quotes($_POST['secreta1']), strip_if_magic_quotes($_POST['secreta2']), $user['id']);
            output_message('notice', '<b>' . $lang['changed_secretq'] . '</b><meta http-equiv=refresh content="4;url=index.php?n=account&sub=manage">');
        } else {
            output_message('alert', '<b>' . $lang['fail_change_secretq'] . '</b><meta http-equiv=refresh content="3;url=index.php?n=account&sub=manage">');
        }
    } elseif ($_GET['action'] == 'resetsecretq') {
        if ($_POST['reset_secretq']) {
            $DB->query("UPDATE account_extend SET secretq1='0',secretq2='0',secreta1='0',secreta2='0' WHERE account_id=?d", $user['id']);
            output_message('notice', '<b>' . $lang['reset_succ_secretq'] . '</b><meta http-equiv=refresh content="4;url=index.php?n=account&sub=manage">');
        }
    } elseif ($_GET['action'] == 'change_gameplay') {
        if ($_POST['switch_wow_type'] == 'wotlk') {
            $DB->query("UPDATE `account` SET expansion='2' WHERE `id`=?d", $user['id']);
            output_message('notice', '<b>' . $lang['exp_set'] . '</b><meta http-equiv=refresh content="4;url=index.php?n=account&sub=manage">');
        } elseif ($_POST['switch_wow_type'] == 'tbc') {
            $DB->query("UPDATE `account` SET expansion='1' WHERE `id`=?d", $user['id']);
            output_message('notice', '<b>' . $lang['exp_set'] . '</b><meta http-equiv=refresh content="4;url=index.php?n=account&sub=manage">');
        } elseif ($_POST['switch_wow_type'] == 'classic') {
            $DB->query("UPDATE `account` SET expansion='0' WHERE `id`=?d", $user['id']);
            output_message('notice', '<b>' . $lang['exp_set'] . '</b><meta http-equiv=refresh content="4;url=index.php?n=account&sub=manage">');
        }
    }
}
" />
				<p class="field_help">Cost in Web Points for users to change the race of their characters</p>
			</div>
			
			<br />
			<!-- In Forum Module Settings -->
			<table>
				<thead>
					<tr>
						<th><center><a name="forum"></a>Forum Integration Settings</center></th>
					</tr>
				</thead>
			</table>
			<br />
			<?php 
output_message('warning', 'Forum bridges have been disabled due to compatibility issues.');
?>
			<br />
			<div class="field">
				<label for="Site module_phpbb3">PhpBB3 Forum: </label>
				<select id="type" class="small" name="cfg__module_phpbb3">
					<?php 
if ($Config->get('module_phpbb3') == 1) {
    $e_pbbf = 'selected="selected"';
    $e_pbbf2 = '';
} else {
    $e_pbbf2 = 'selected="selected"';
    $e_pbbf = '';
}
?>
					<option value="1" <?php 
Example #18
0
				}
			} else
			{
				$req_tpl = true ;
				@include ( $script_file ) ;

			}
		}
	}
	if ( empty( $_GET['nobody'] ) )
	{
		// DEBUG //
		if ( ( int )$MW->getConfig->generic->debuginfo )
		{
			output_message( 'debug', 'DEBUG://' . $DB->_statistics['count'] ) ;
			output_message( 'debug', '<pre>' . print_r( $_SERVER, true ) . '</pre>' ) ;
		}
		// =======//

		// Start Loading Of Template Files
		include ( '' . $offtmp . '/body_functions.php' );
		ob_start() ;
		include ( '' . $offtmp . '/body_header.php' );
		ob_end_flush() ;

		if ( $req_tpl )
		{
			if ( file_exists( $template_file ) )
			{
				// Only cache if user is not logged in.
				if ( $user['id'] < 0 && ( int )$MW->getConfig->generic->cache_expiretime != 0 )
<?php 
$stylesheets = "";
$fluid_view = true;
$javascript = "";
$incl_message_error = true;
?>

<?php 
include HEADER;
include NAV;
?>

<?php 
echo isset($valid) ? $valid->form_errors() : "";
echo isset($message) ? output_message($message) : "";
?>

<!--<body class="gray-bg">-->

    <div class="passwordBox animated fadeInDown">
        <div class="row">

            <div class="col-md-12">
                <div class="ibox-content">

                    <h2 class="font-bold">Forgot password</h2>

                    <p>
                        Enter your user name and your password will be reset and emailed to you.
                    </p>
Example #20
0
if ($_GET['realm']) {
    $realm_info = get_realm_byid($_GET['realm']);
    $pathway_info[] = array('title' => $realm_info['name'], '');
    $cc = 0;
    $rid = $realm_info['cloneid'] == -1 ? $realm_info['id'] : $realm_info['cloneid'];
    $rrealm_info = get_realm_byid($rid);
    AddMangosFields($rrealm_info['Version']);
    $charinfo_link = $rrealm_info['WowdCharInfoLink'];
    $faction_alliance = 0;
    $faction_horde = 0;
    $total = 0;
    if (check_port_status($rrealm_info['address'], $rrealm_info['port']) !== true) {
        output_message('alert', 'Realm <b>' . $rrealm_info['name'] . '</b> is offline <img src="images/downarrow2.gif" border="0" align="top">');
    } else {
        if (!$rrealm_info['CharacterDatabaseInfo']) {
            output_message('alert', 'Check field <u>CharacterDatabaseInfo</u> in table `realmlist` for realm id=' . $realm_info['id']);
        }
        $wsdb_info = parse_worlddb_info($rrealm_info['CharacterDatabaseInfo']);
        if ($DB) {
            $query = $DB->select("SELECT c.*, a.*   FROM " . $wsdb_info['db'] . ".`characters` as c, `account` as a \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE ((c.`online`='1') AND (c.`account`=a.`id`)) \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tORDER BY c.`name`");
        }
        $faction_alliance = 0;
        $faction_horde = 0;
        $total = 0;
        foreach ($query as $result) {
            if ($res_color == 1) {
                $res_color = 2;
            } else {
                $res_color = 1;
            }
            $cc++;
Example #21
0
    $password = "";
}
?>
<html>
  <head>
    <title>Photo Gallery</title>
    <link href="../stylesheets/main.css" media="all" rel="stylesheet" type="text/css" />
  </head>
  <body>
    <div id="header">
      <h1>Photo Gallery</h1>
    </div>
    <div id="main">
		<h2>Staff Login</h2>
		<?php 
echo output_message($message = "");
?>

		<form action="login.php" method="post">
		  <table>
		    <tr>
		      <td>Username:</td>
		      <td>
		        <input type="text" name="username" maxlength="30" value="<?php 
echo htmlentities($username);
?>
" />
		      </td>
		    </tr>
		    <tr>
		      <td>Password:</td>
Example #22
0
<?php

require 'app/sequencer.php';
$autoplay = 0;
if (isset($_GET['random'])) {
    $id = db_result(db_query('SELECT id FROM sequences WHERE deleted=0 AND scale>=0 AND LENGTH(data) > 500 ORDER BY RAND() LIMIT 1'), 0);
    $autoplay = 1;
}
if ($id != 0) {
    $result = db_query('SELECT * FROM sequences WHERE deleted=0 AND id="' . e_mysql($id) . '" LIMIT 1');
    if (mysqli_num_rows($result) == 0) {
        output_message('Error', 'Unknown sequence: ' . e_html($id));
        exit;
    }
    $row = mysqli_fetch_array($result);
    $title = formatSequenceTitle($row);
    $nav_right = formatSequenceInfo($row);
}
if ($id != 0) {
    $cname = $id;
}
if ($id == 0) {
    $showFeatured = true;
}
output_header($id == 0 ? 'Make music online' : $title, false, $id);
?>
<style type="text/css">
#main {
    bottom: 0;
}
</style>
Example #23
0
                            }
                        }
                    } else {
                        if ($action == 'changesexfix') {
                            $WSDB->query("INSERT INTO `mwfe3_character_actions` \n                      (`guid`, `account`, `action`, `timeaction`, `data`) \n                        VALUES\n                      (?d,?d,?,?,?);", $my_char->guid, $user['id'], $action, $timecurrf, $my_char->sqlinfo['data']);
                            $my_char->ChangeGenderFix($mangos_field, $char_models);
                            $WSDB->query("UPDATE `characters` SET `data`=?a WHERE account=?d and `guid`=?d LIMIT 1", $my_char->sqlinfo, $user['id'], $my_char->guid);
                            output_message('notice', 'Фикс после смены пола персонажа выполнен успешно!' . '<meta http-equiv=refresh content="2;url=index.php?n=account&sub=chars">');
                        } else {
                            if ($action == 'move') {
                                output_message('notice', 'Перемещение!');
                            } else {
                                if ($action == 'changed') {
                                    output_message('notice', 'Обмен!');
                                }
                            }
                        }
                    }
                }
            } else {
                output_message('alert', $strErrorMsg . '<meta http-equiv=refresh content="2;url=index.php?n=account&sub=chars">');
            }
        }
    }
}
?>




Example #24
0
<?php 
include_layout_template("header.php");
$page = isset($_GET['page']) ? (int) $_GET['page'] : 1;
$record_no = 3;
$total_records = Photograph::count();
// $photo_object = new Photograph();
// $photos = $photo_object->find_all();
$pagination = new Pagination($page, $record_no, $total_records);
$sql_query = "SELECT * FROM photograph ";
$sql_query .= "LIMIT {$record_no} ";
$sql_query .= "OFFSET {$pagination->offset()} ";
$photos = Photograph::find_by_sql($sql_query);
?>
	<h2>Photos</h2>
	<?php 
echo output_message($session->set_get_message());
?>
		<?php 
foreach ($photos as $photo) {
    ?>
		   <div style="float:left;margin-left: 20px; display:inline;">
		   	<a href="photo.php?id=<?php 
    echo $photo->id;
    ?>
">
		   		<img src="<?php 
    echo $photo->image_path();
    ?>
" width="200"  />
		   	</a>
		   	<p><?php 
Example #25
0
function send_email($goingto, $toname, $sbj, $messg)
{
    global $Config;
    define('DISPLAY_XPM4_ERRORS', true);
    // display XPM4 errors
    $core_em = $Config->get('site_email');
    // If email type "0" (SMTP)
    if ($Config->get('email_type') == 0) {
        require_once 'core/mail/SMTP.php';
        // path to 'SMTP.php' file from XPM4 package
        $f = '' . $core_em . '';
        // from mail address
        $t = '' . $goingto . '';
        // to mail address
        // standard mail message RFC2822
        $m = 'From: ' . $f . "\r\n" . 'To: ' . $t . "\r\n" . 'Subject: ' . $sbj . "\r\n" . 'Content-Type: text/plain' . "\r\n\r\n" . '' . $messg . '';
        $h = explode('@', $t);
        // get client hostname
        $c = SMTP::MXconnect($h[1]);
        // connect to SMTP server (direct) from MX hosts list
        $s = SMTP::Send($c, array($t), $m, $f);
        // send mail
        // print result
        if ($s) {
            output_message('success', 'Mail Sent!');
        } else {
            output_message('error', print_r($_RESULT));
        }
        SMTP::Disconnect($c);
        // disconnect
    } elseif ($Config->get('email_type') == 1) {
        require_once 'core/mail/MIME.php';
        // path to 'MIME.php' file from XPM4 package
        // compose message in MIME format
        $mess = MIME::compose($messg);
        // send mail
        $send = mail($goingto, $sbj, $mess['content'], 'From: ' . $core_em . '' . "\n" . $mess['header']);
        // print result
        echo $send ? output_message('success', 'Mail Sent!') : output_message('error', 'Error!');
    } elseif ($Config->get('email_type') == 2) {
        require_once 'core/mail/MAIL.php';
        // path to 'MAIL.php' file from XPM4 package
        $m = new MAIL();
        // initialize MAIL class
        $m->From($core_em);
        // set from address
        $m->AddTo($goingto);
        // add to address
        $m->Subject($sbj);
        // set subject
        $m->Html($messg);
        // set html message
        // connect to MTA server 'smtp.hostname.net' port '25' with authentication: 'username'/'password'
        if ($Config->get('email_use_secure') == 1) {
            $c = $m->Connect($Config->get('email_smtp_host'), $Config->get('email_smtp_port'), $Config->get('email_smtp_user'), $Config->get('email_smtp_pass'), $Config->get('email_smtp_secure')) or die(print_r($m->Result));
        } else {
            $c = $m->Connect($Config->get('email_smtp_host'), $Config->get('email_smtp_port'), $Config->get('email_smtp_user'), $Config->get('email_smtp_pass')) or die(print_r($m->Result));
        }
        // send mail relay using the '$c' resource connection
        echo $m->Send($c) ? output_message('success', 'Mail Sent!') : output_message('error', 'Error! Please check your config and make sure you inserted your MTA info correctly.');
        $m->Disconnect();
        // disconnect from server
        // print_r($m->History); // optional, for debugging
    }
}
function banUser($bannid, $banreason)
{
    global $DB, $user, $Account;
    if (!$banreason) {
        $banreason = "Not Specified";
    }
    if ($Account->banAccount($bannid, $banreason, $user['username']) == TRUE) {
        output_message('success', 'Success. Account #' . $bannid . ' Successfully banned. Reason: ' . $banreason . '');
    }
}
    $subj_last_name = $row["last_name"];
    $subj_gender = $row["gender"];
    $subj_bdate = $row["birth_date"];
    $subj_email = $row["email"];
    $subj_tested = $row["tested"];
    $subj_status = $row["status"];
    ?>

   <h1 class="subjects"><?php 
    echo $subj_first_name . " " . $subj_last_name;
    ?>
</h1>
   
   <div id="list_details">
   <?php 
    output_message();
    ?>

      <p><strong><?php 
    __("First Name");
    ?>
:</strong> <?php 
    echo $subj_first_name;
    ?>
</p>
      <p><strong><?php 
    __("Last Name");
    ?>
:</strong> <?php 
    echo $subj_last_name;
    ?>
Example #28
0
<?php

if (INCLUDED !== true) {
    exit;
}
// ==================== //
$pathway_info[] = array('title' => $lang['retrieve_pass'], 'link' => '');
// ==================== //
if ($_POST['retr_login'] && $_POST['retr_email']) {
    $retr_info = $DB->selectRow("SELECT `username`,`password`,`email` FROM `account` WHERE username=? AND email=? LIMIT 1", $_POST['retr_login'], $_POST['retr_email']);
    if ($retr_info['password']) {
        $email_text = sprintf($lang['email_retrieve_pass'], $retr_info['password']);
        send_email($retr_info['email'], $retr_info['username'], '== ' . $config['site_title'] . ' password retrive ==', $email_text);
        output_message('notice', '<b>' . $lang['retrieve_pass_succ'] . '.</b>');
        redirect('index.php?n=account&sub=login', 0, 3);
    } else {
        output_message('alert', $lang['retrieve_pass_fail']);
        redirect('index.php?n=account&sub=restore', 0, 3);
    }
}
            </div>
        <?php 
}
?>
        <?php 
if (empty($comments)) {
    echo "No Comments.";
}
?>
    </div>


    <div id="comment-form">
        <h3>New Comment</h3>
        <?php 
echo output_message($message);
?>
        <form action="photo.php?id=<?php 
echo $photo->id;
?>
" method="post">
            <table>
                <tr>
                    <td>Your name:</td>
                    <td><input type="text" name="author" value="<?php 
echo $author;
?>
" /></td>
                </tr>
                <tr>
                    <td>Your comment:</td>
function setUsed()
{
    global $DB;
    $DB->query("UPDATE mw_regkeys SET used=1 WHERE `id`='" . $_GET['keyid'] . "'");
    output_message('success', 'Key set as Used!');
}