Пример #1
0
function account_login($error = '')
{
    if (is_user()) {
        return;
    }
    global $CPG_SESS, $MAIN_CFG, $cpgtpl, $pagetitle;
    $pagetitle .= ' ' . _BC_DELIM . ' ' . _USERLOGIN;
    require_once 'header.php';
    if (isset($_GET['redirect']) && !isset($CPG_SESS['user']['redirect'])) {
        $CPG_SESS['user']['redirect'] = $CPG_SESS['user']['uri'];
    }
    $cpgtpl->assign_vars(array('U_LOGIN' => isset($CPG_SESS['user']['redirect']) ? $CPG_SESS['user']['redirect'] : URL::index(), 'U_REGISTER' => $MAIN_CFG['member']['allowuserreg'] ? URL::index('&file=register') : false, 'U_LOSTPASS' => URL::index('&op=pass_lost'), 'S_LOGIN_ERROR' => $error, 'S_SEC_IMG' => $MAIN_CFG['global']['sec_code'] & 2 ? generate_secimg() : false));
    $cpgtpl->set_filenames(array('body' => 'your_account/login.html'));
    $cpgtpl->display('body');
}
Пример #2
0
	' . _YOUMAYINCLUDE . '
	<br /><br />
	<table width="400" border="0" cellpadding="0" cellspacing="0" style="margin:auto;">
	<tr>
	  <td style="width:100px;"><strong>{sender}</strong></td><td>' . _DESCSENDER . '</td>
	</tr><tr>
	  <td><strong>{recipient}</strong></td><td>' . _DESCRECIPIENT . '</td>
	</tr><tr>
	  <td><strong>{sitename}</strong></td><td>' . _DESCSITENAME . '</td>
	</tr><tr>
	  <td><strong>{slogan}</strong></td><td>' . _DESCSLOGAN . '</td>
	</tr><tr>
	  <td><strong>{users}</strong></td><td>' . _DESCUSERS . ', ' . $reg_users . '</td>
	</tr><tr>
	  <td><strong>{hits}</strong></td><td>' . _DESCHITS . ', ' . $total_hits . '</td>
	</tr><tr>
	  <td><strong>{founded}</strong></td><td>' . _DESCFOUNDED . '</td>
	</tr><tr>
	  <td><strong>{url}</strong></td><td>' . _DESCURL . '</td>
	</tr>
	</table>
	<br />
	<table style="margin:auto;"><tr><td>' . $bbcode . '</td></tr></table>
	<textarea name="personal_message" cols="63" rows="17" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" onchange="storeCaret(this);">' . $message_insert . '</textarea>
	<br /><br />
	' . generate_secimg(7) . '<br />' . _TYPESECCODE . '<br /><input type="text" name="gfx_contact_check" size="10" maxlength="8" /><br />
	<input type="submit" name="sendMessage" value="' . _SEND . '" />
	</div>
	</form>';
    CloseTable();
}
Пример #3
0
        $content .= '&nbsp;&nbsp;' . _NEW . ": <b>{$pm}</b><br />\n";
    }
    $content .= '<a title="' . _ACCOUNTOPTIONS . '" href="' . URL::index('Your_Account') . '"><img src="images/blocks/logout.gif" alt="" /></a>&nbsp;<a title="' . _ACCOUNTOPTIONS . '" href="' . URL::index('Your_Account') . '">' . _Your_AccountLANG . '</a><br />
	<a title="' . _LOGOUTACCT . '" href="' . URL::index('Your_Account&amp;op=logout&amp;redirect', false) . '"><img src="images/blocks/login.gif" alt="" style="float:left;" /></a>&nbsp;<a title="' . _LOGOUTACCT . '" href="' . URL::index('Your_Account&amp;op=logout&amp;redirect', false) . '">' . _LOGOUT . '</a>';
} else {
    if (isset($_GET['redirect']) && !isset($CPG_SESS['user']['redirect'])) {
        $CPG_SESS['user']['redirect'] = $CPG_SESS['user']['uri'];
    }
    $redirect = isset($CPG_SESS['user']['redirect']) ? $CPG_SESS['user']['redirect'] : URL::uri();
    $content .= '<div style="text-align:center;"><img src="images/blocks/no_avatar.gif" alt="" /><br />' . _BWEL . ' <b>' . _ANONYMOUS . '</b></div>
	<hr /><form action="' . $redirect . '" method="post" enctype="multipart/form-data" accept-charset="utf-8" style="margin:0;"><div>
	<span style="float:left; height:25px;">' . _NICKNAME . '</span><span style="float:right; height:25px;"><input type="text" name="ulogin" size="10" maxlength="25" /></span><br />
	<span style="float:left; height:25px;">' . _PASSWORD . '</span><span style="float:right; height:25px;"><input type="password" name="user_password" size="10" maxlength="20" /></span><br />
	';
    if ($MAIN_CFG['debug']['sec_code'] & 2) {
        $content .= '<span style="float:left; height:25px;">' . _SECURITYCODE . '</span><span style="float:right; height:25px;">' . generate_secimg() . '</span><br style="clear:left;" />
		<span style="float:left; height:25px;">' . _TYPESECCODE . '</span><span style="float:right; height:25px;"><input type="text" name="gfx_check" size="8" maxlength="8" /></span><br />';
    }
    // don't show register link unless allowuserreg is yes
    $content .= '<span style="float:left; height:25px;">' . ($MAIN_CFG['member']['allowuserreg'] ? '<input type="button" value="' . _BREG . '" onclick="window.location=\'' . URL::index('Your_Account&amp;file=register', 1, 1) . '\'" />' : '') . '</span>
	<span style="float:right; height:25px;"><input type="submit" value="' . _LOGIN . '" />
	</span></div></form>';
}
if (is_admin()) {
    $content .= '<br style="clear:left;"/><a title="' . _LOGOUTADMINACCT . '" href="' . URL::admin('logout') . '"><img src="images/blocks/login.gif" alt="" /></a>&nbsp;<a title="' . _LOGOUTADMINACCT . '" href="' . URL::admin('logout') . '">' . _ADMIN . ' ' . _LOGOUT . "</a><br />\n";
}
$day = L10NTime::tolocal(mktime(0, 0, 0, date('n'), date('j'), date('Y')) - date('Z'), $userinfo['user_dst'], $userinfo['user_timezone']);
list($last[0]) = $db->sql_ufetchrow("SELECT COUNT(*) FROM " . $user_prefix . "_users \n\tWHERE user_regdate>='" . $day . "'", SQL_NUM);
list($last[1]) = $db->sql_ufetchrow("SELECT COUNT(*) FROM " . $user_prefix . "_users \n\tWHERE user_regdate<'" . $day . "' AND user_regdate>='" . ($day - 86400) . "'", SQL_NUM);
list($lastuser) = $db->sql_ufetchrow("SELECT username FROM " . $user_prefix . "_users \n\tWHERE user_active = 1 AND user_level > 0 \n\tORDER BY user_id DESC", SQL_NUM);
list($numusers) = $db->sql_ufetchrow("SELECT COUNT(*) FROM " . $user_prefix . "_users \nWHERE user_id > 1 AND user_level > 0", SQL_NUM);
Пример #4
0
function login()
{
    global $MAIN_CFG, $pagetitle, $adminindex;
    $pagetitle .= ' ' . _BC_DELIM . ' ' . _ADMINLOGIN;
    require 'header.php';
    OpenTable();
    echo open_form($adminindex, 'login', _ADMINLOGIN) . '
	<label for="alogin" class="ulog">' . _ADMINID . '</label><input class="set" type="text" name="alogin" id="alogin" size="20" maxlength="25" /><br />
	<label for="pwd" class="ulog">' . _PASSWORD . '</label><input class="set" type="password" name="pwd" id="pwd" size="20" maxlength="40" /><br />';
    if ($MAIN_CFG['global']['sec_code'] & 1) {
        echo '<label for="gfx_check" class="ulog">' . _SECURITYCODE . ':</label>' . generate_secimg(7) . '<br />
		<label for="gfx_check" class="ulog">' . _TYPESECCODE . ':</label><input class="set" type="text" name="gfx_check" id="gfx_check" size="10" maxlength="8" /><br />';
    }
    echo '<label for="persistent" class="ulog">' . _LOGIN_REMEMBERME . '</label><input type="checkbox" name="persistent" id="persistent" value="1" /><br />
	<div style="text-align:center;"><input type="submit" class="sub" value="' . _LOGIN . '" /></div>' . close_form();
    echo '<script type="text/javascript">document.getElementById("alogin").focus();</script>';
    CloseTable();
    require 'footer.php';
}
Пример #5
0
$bb = $MAIN_CFG['email']['allow_html_email'] || is_admin() ? bbcode_table('message', 'email_mod', 0) : '';
$html = $MAIN_CFG['email']['allow_html_email'] || is_admin() ? 1 : 0;
if (is_admin()) {
    $sender_email = $MAIN_CFG['global']['adminmail'];
    $sender_name = $MAIN_CFG['global']['sitename'];
    $recip = '<label for="send_to"><strong>' . _SEND_TO . '</strong></label><br /><input type="text" name="send_to" id="send_to" size="30" maxlength="255" /><br />';
}
if (!isset($_POST['opi'])) {
    if (is_user()) {
        $sender_name = !empty($userinfo['name']) ? $userinfo['name'] : $userinfo['username'];
        $sender_email = $userinfo['user_email'];
    }
    require_once 'header.php';
    generate_secimg();
    $cpgtpl->set_handle('body', 'contact/index.html');
    $cpgtpl->assign_vars(array('S_SITENAME' => $MAIN_CFG['global']['sitename'], 'S_SENDER' => $sender_name, 'S_SENDER_MAIL' => $sender_email, 'S_MESSAGE' => $message, 'S_BB' => $bb, 'S_RECIP' => $recip, 'S_GFX_IMG' => generate_secimg(), 'U_ACTION' => URL::index($module_name)));
    $cpgtpl->display('body');
} elseif ($_POST['opi'] == 'ds') {
    if (!Security::check_post()) {
        cpg_error(_SEC_ERROR);
    }
    if (empty($sender_name)) {
        $error = _ENT_NAME_LABEL;
    }
    if (empty($message)) {
        $error = _ENT_MESSAGE_LABEL;
    }
    if (!is_email($sender_email)) {
        $error = $PHPMAILER_LANG['from_failed'] . ' ' . $sender_email;
    }
    if (!isset($error)) {
Пример #6
0
					<input type="checkbox" name="code_show[]" value="2" ' . ($MAIN_CFG['global']['sec_code'] & 2 ? 'checked="checked"' : '') . ' />Member login<br />
					<input type="checkbox" name="code_show[]" value="4" ' . ($MAIN_CFG['global']['sec_code'] & 4 ? 'checked="checked"' : '') . ' />Member registration<br />'), array('L_TITLE' => 'Use background image', 'L_TOOLTIP' => '', 'B_INPUT' => false, 'S_TYPE' => yesno_option('sec_code[back_img]', $MAIN_CFG['sec_code']['back_img'])));
        if (function_exists('imagettftext')) {
            $fontlist = array();
            $handle = opendir(CORE_PATH . 'fonts');
            while ($file = readdir($handle)) {
                if (preg_match('#\\.ttf$#', $file)) {
                    $fontlist[$file] = substr($file, 0, -4);
                }
            }
            closedir($handle);
            natcasesort($fontlist);
            array_unshift($fontlist, '[system]');
            $avail_settings[] = array('L_TITLE' => 'Font face', 'L_TOOLTIP' => '', 'B_INPUT' => false, 'S_TYPE' => select_box('sec_code[font]', $MAIN_CFG['sec_code']['font'], $fontlist) . ' ' . select_option('sec_code[font_size]', $MAIN_CFG['sec_code']['font_size'], array(8, 10, 12, 14, 16)) . ' px.');
        }
        $avail_settings[] = array('L_TITLE' => _PREVIEW, 'L_TOOLTIP' => '', 'B_INPUT' => false, 'S_TYPE' => generate_secimg());
    } elseif ($section == 11) {
        global $adminindex, $mainindex;
        $ignore = array('banners.php', 'error.php', 'header.php', 'footer.php', 'install.php');
        $filesa = $filesi = array();
        $dir = dir(BASEDIR);
        while ($file = $dir->read()) {
            if (is_file(BASEDIR . $file) && preg_match('#\\.php$#', $file) && !in_array($file, $ignore)) {
                if ($file != 'index.php') {
                    $filesa[] = $file;
                }
                $filesi[] = $file;
            }
        }
        $dir->close();
        natcasesort($filesa);
Пример #7
0
function postcomment()
{
    global $userinfo, $AllowableHTML, $db, $prefix, $MAIN_CFG;
    if (!$MAIN_CFG['Reviews']['anon_comments'] && !is_user()) {
        cpg_error('Sorry, anonymous comments not allowed [ ' . _RCREATEACCOUNT . ' ]<br /><br />');
    }
    $id = intval($_GET['id']);
    list($title) = $db->sql_ufetchrow("SELECT title FROM " . $prefix . "_reviews WHERE id='{$id}'");
    if (!$title) {
        cpg_error('Review does not exist!');
    }
    require_once 'header.php';
    OpenTable();
    echo '<div style="text-align:center;" class="option"><b>' . _REVIEWCOMMENT . " {$title}</b><br /><br /></div>" . '<form action="' . URL::index() . '" method="post"><div>';
    if (!is_user()) {
        echo '<b>' . _YOURNICK . '</b> ' . _ANONYMOUS . ' [ ' . _RCREATEACCOUNT . ' ]<br /><br />';
        $uname = $anonymous;
    } else {
        echo '<b>' . _YOURNICK . '</b> ' . $userinfo['username'] . '<br />
    	<input type="checkbox" name="xanonpost" /> ' . _POSTANON . '<br /><br />';
        $uname = $userinfo['username'];
    }
    echo '
    <input type="hidden" name="uname" value="' . $uname . '" />
    <input type="hidden" name="id" value="' . $id . '" />
    <b>' . _SELECTSCORE . '</b>
    <select name="score">
    <option name="score" value="10" />10</option>
    <option name="score" value="9" />9</option>
    <option name="score" value="8" />8</option>
    <option name="score" value="7" />7</option>
    <option name="score" value="6" />6</option>
    <option name="score" value="5" />5</option>
    <option name="score" value="4" />4</option>
    <option name="score" value="3" />3</option>
    <option name="score" value="2" />2</option>
    <option name="score" value="1" />1</option>
    </select><br /><br />
    <b>' . _YOURCOMMENT . '</b><br />
    <textarea name="comments" rows="10" cols="70"></textarea><br />
    <br /><br />
	' . generate_secimg(7) . '<br />' . _TYPESECCODE . '<br />
	<input type="text" name="gfx_contact_check" size="10" maxlength="8" /><br />
    <input type="hidden" name="rop" value="savecomment" />
    <input type="submit" value="Submit" />
    </div></form>
    ';
    CloseTable();
}
Пример #8
0
function register_check()
{
    global $db, $user_cfg, $sec_code, $MAIN_CFG;
    $username = Fix_Quotes($_POST['username'], 1);
    $email = strtolower(Fix_Quotes($_POST['email'], 1));
    $password = Fix_Quotes($_POST['password'], 1);
    if ($password != Fix_Quotes($_POST['password_confirm'], 1)) {
        cpg_error(_PASSDIFFERENT);
    } else {
        if (strlen($password) < $MAIN_CFG['member']['minpass'] && $password != '') {
            cpg_error(_YOUPASSMUSTBE . ' <b>' . $MAIN_CFG['member']['minpass'] . '</b> ' . _CHARLONG);
        }
    }
    $fields['username'] = $username;
    $fields['email'] = $email;
    $fields['password'] = $password;
    $fields['coppa'] = $_POST['coppa'];
    // Check the additional activated fields
    $fieldlist = $valuelist = '';
    $content = check_fields($fieldlist, $valuelist, $fields);
    userCheck($username, $email);
    echo '<form action="' . URL::index('&amp;file=register') . '" method="post">
<table border="0" cellpadding="3" cellspacing="1" width="100%" class="forumline">
  <tr>
	<td class="row1" align="center">
	  ' . $username . ', ' . _USERCHECKDATA . '<br /><br />
	  <table border="0" cellpadding="1" cellspacing="4">
	  <tr><td><b>' . _USERNAME . ':</b></td><td>' . $username . '</td></tr>
	  <tr><td><b>' . _EMAILADDRESS . ':</b></td><td>' . $email . '</td></tr>
	  <tr><td><b>' . _PASSWORD . ':</b></td><td><i>' . _MA_HIDDEN . '</i></td></tr>' . $content;
    if ($sec_code & 4) {
        echo '<tr>
	<td class="row1"><span class="gen">' . _SECURITYCODE . ':</span></td>
	<td class="row2">' . generate_secimg() . '</td></tr>
  <tr>
	<td class="row1"><span class="gen">' . _TYPESECCODE . ':</span></td>
	<td class="row2"><input type="text" name="gfx_check" size="7" maxlength="6" /></td>
  </tr>';
    }
    echo '</table><br />';
    if (!$user_cfg['requireadmin']) {
        echo $user_cfg['useactivate'] ? _YOUWILLRECEIVE : _YOUWILLRECEIVE2;
    } else {
        echo _WAITAPPROVAL;
    }
    $_SESSION['REGISTER'] = $fields;
    echo '<input type="hidden" name="op" value="finish" /><br /><br />
	<input type="submit" value="' . _FINISH . '" /> <a href="javascript:history.go(-1);"><input type="button" value="Back" onclick="history.go(-1)" /></a>
	</td>
  </tr>
</table>
</form>';
}
Пример #9
0
         if (validate_secimg()) {
             $fetchpage = false;
         } else {
             $pagetitle .= ' ' . _BC_DELIM . ' Error';
             $error = 'Incorrect security code. Please type the code exactly as it appears.';
         }
     } else {
         $pagetitle .= ' ' . _BC_DELIM . ' ' . $dl_title;
         $error = '';
     }
 } else {
     $pagetitle .= ' ' . _BC_DELIM . ' Confirmation';
 }
 if ($fetchpage) {
     require_once 'header.php';
     $cpgtpl->assign_vars(array('DL_DETAIL_MENU' => dl_detail_menu($get_id, $dl_title, $dl_pick, $dl_active, 2), 'L_DL_FILE' => _DLP_DLNOW, 'S_DL_NOW' => false, 'S_DL_DESC1' => 'Please type the security code displayed below.', 'S_DL_DESC2' => 'Clicking "Download Now" will transfer you to the appropriate download location.', 'S_ERRORS' => !empty($error) ? display_errors($error) : '', 'U_DL_FORM' => URL::index("&amp;get={$get_id}&amp;mirror={$mirror_id}"), 'L_SECURITYCODE' => _SECURITYCODE, 'IMG_SECCODE' => generate_secimg(), 'L_TYPESECCODE' => _TYPESECCODE, 'L_GET_DOWNLOAD' => _DLP_DLNOW));
 } else {
     if (!is_admin() && $dl_submitter != is_user()) {
         $time = time();
         $time_year = generate_date($time, 'Y');
         $time_month = generate_date($time, 'm');
         if (!$db->sql_query("UPDATE " . $dl_prefix . "_stats \n\t\t\t\t\t\tSET hits=hits+1 \n\t\t\t\t\t\tWHERE id='{$get_id}' AND year='{$time_year}' AND month='{$time_month}'", true) || !$db->sql_affectedrows()) {
             $db->sql_query('INSERT INTO ' . $dl_prefix . "_stats \n\t\t\t\t\t\t(id, year, month, hits) \n\t\t\t\t\t\tVALUES \n\t\t\t\t\t\t({$get_id}, {$time_year}, {$time_month}, 1)", false);
         }
     }
     if ($remote && !$dl_config['leech_remote'] || !$remote && !$dl_config['leech_local']) {
         url_refresh($dl_url, 5);
         require_once 'header.php';
         $cpgtpl->assign_vars(array('DL_DETAIL_MENU' => dl_detail_menu($get_id, $dl_title, $dl_pick, $dl_active, 2), 'L_DL_FILE' => _DLP_DLNOW, 'S_DL_NOW' => 'Your download will begin in five seconds...<br /><br />If the file has not started to download after five seconds, get it <a href="' . $dl_url . '">here</a>.'));
     } else {
         require_once 'includes/classes/cpg_file.php';