本文整理汇总了PHP中icms_core_DataFilter::checkVar方法的典型用法代码示例。如果您正苦于以下问题:PHP icms_core_DataFilter::checkVar方法的具体用法?PHP icms_core_DataFilter::checkVar怎么用?PHP icms_core_DataFilter::checkVar使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类icms_core_DataFilter
的用法示例。
在下文中一共展示了icms_core_DataFilter::checkVar方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: vardump
/**
* Output a dump of a variable
* This takes the place of icms_debug_vardump()
*
* @param string $var
*/
public static function vardump($var)
{
if (class_exists('icms_core_Textsanitizer')) {
self::message(icms_core_DataFilter::checkVar(var_export($var, true), 'text', 'output'));
} else {
$var = var_export($var, true);
$var = preg_replace("/(\r\n)|(\r)|(\n)/", "<br />", $var);
self::message($var);
}
}
示例2: getViewItemLink
/**
* Build a link to the page represented by the symlink, if available
* @return string
*/
public function getViewItemLink()
{
$url = substr($this->getVar('page_url', 'e'), 0, 7) == 'http://' ? $this->getVar('page_url', 'e') : ICMS_URL . '/' . $this->getVar('page_url', 'e');
$url = icms_core_DataFilter::checkVar($url, 'url', 'host');
if (!$url) {
$ret = '';
} else {
$ret = '<a href="' . $url . '" alt="' . _PREVIEW . '" title="' . _PREVIEW . '" rel="external"><img src="' . ICMS_IMAGES_SET_URL . '/actions/viewmag.png" /></a>';
}
return $ret;
}
示例3: toArray
/**
* Overridding IcmsPersistable::toArray() method to add a few info
*
* @global array $icmsConfigUser user configuration
* @return array of tribetopic info
*/
public function toArray()
{
global $icmsConfigUser;
$ret = parent::toArray();
$ret['post_time'] = formatTimestamp($this->getVar('post_time', 'e'), 'm');
$ret['poster_uname'] = icms_member_user_Handler::getUserLink($this->getVar('poster_uid'));
$ret['userCanEditAndDelete'] = $this->userCanEditAndDelete();
$thisUser = icms::handler('icms_member')->getUser($this->getVar('poster_uid'));
if (is_object($thisUser)) {
// get poster avatar
$avatar = $thisUser->gravatar();
if ($icmsConfigUser['avatar_allow_gravatar'] || strpos($avatar, 'http://www.gravatar.com/avatar/') === false) {
$ret['poster_avatar'] = '<img src="' . $thisUser->gravatar() . '" />';
}
// get poster signature
if (trim($thisUser->getVar('user_sig')) && $this->getVar('attachsig')) {
$ret['poster_signature'] = icms_core_DataFilter::checkVar($thisUser->getVar('user_sig', 'N'), 'html', 'output');
}
}
// rewrite edit and delete item links to work with tribes.php
$ret['editItemLink'] = str_replace($this->handler->_itemname . '.php?op=mod', 'tribes.php?tribes_id=' . $this->getVar('tribes_id') . '&topic_id=' . $this->getVar('topic_id') . '&op=edittribepost', $this->getEditItemLink(false, true, true));
$ret['deleteItemLink'] = str_replace($this->handler->_itemname . '.php?op=del', 'tribes.php?tribes_id=' . $this->getVar('tribes_id') . '&topic_id=' . $this->getVar('topic_id') . '&op=deltribepost', $this->getDeleteItemLink(false, true, true));
return $ret;
}
示例4: icms_view_PageNav
$icmsTpl->assign('profile_tribe_topic', $tribetopicObj->toArray());
$icmsTpl->assign('profile_tribe_posts', $profile_tribepost_handler->getPosts($clean_start, icms::$module->config['tribepostsperpage'], false, $clean_topic_id));
// make page navigation
$pagenav = new icms_view_PageNav($total_posts_count, icms::$module->config['tribepostsperpage'], $clean_start, 'start', 'tribes_id=' . $clean_tribes_id . '&topic_id=' . $clean_topic_id);
$icmsTpl->assign('profile_tribe_posts_pagenav', $pagenav->renderNav());
// make form
if (!$tribetopicObj->getVar('closed')) {
edittribepost($clean_topic_id, 0, $tribesObj, true);
}
icms_makeSmarty(array('lang_closed' => _MD_PROFILE_TRIBETOPIC_CLOSED));
}
} else {
$icmsTpl->assign('lang_joinfirst', _MD_PROFILE_TRIBES_JOINFIRST);
}
} elseif (isset($_POST['search_title'])) {
$clean_tribes_title = trim(icms_core_DataFilter::checkVar($_POST['search_title'], 'str'));
$tribes = array();
$tribes['search'] = $profile_tribes_handler->searchTribes($clean_tribes_title);
$icmsTpl->assign('profile_tribes', $tribes);
$icmsTpl->assign('lang_tribes_search_title', sprintf(_MD_PROFILE_TRIBES_SEARCH_TITLE, $clean_tribes_title));
if (count($tribes['search']) == 0) {
$icmsTpl->assign('lang_search_noresults', sprintf(_MD_PROFILE_TRIBES_SEARCH_NORESULTS, $clean_tribes_title));
}
$icmsTpl->assign('profile_tribes_search', true);
} elseif ($clean_uid > 0 || $real_uid > 0) {
$uid = $clean_uid > 0 ? $clean_uid : $real_uid;
$tribes = array();
$tribes['own'] = $profile_tribes_handler->getTribes(false, false, $uid);
$tribes['member'] = $profile_tribes_handler->getMembershipTribes($uid);
if (count($tribes['own']) + count($tribes['member']) == 0) {
$icmsTpl->assign('lang_nocontent', _MD_PROFILE_TRIBES_NOCONTENT);
示例5: icms_form_elements_Hidden
$form->addElement($group_hidden);
}
}
$inactive_hidden = new icms_form_elements_Hidden("mail_inactive", @$_POST['mail_inactive']);
$lastlog_min_hidden = new icms_form_elements_Hidden("mail_lastlog_min", icms_core_DataFilter::checkVar($_POST['mail_lastlog_min'], 'text'));
$lastlog_max_hidden = new icms_form_elements_Hidden("mail_lastlog_max", icms_core_DataFilter::checkVar($_POST['mail_lastlog_max'], 'text'));
$regd_min_hidden = new icms_form_elements_Hidden("mail_regd_min", icms_core_DataFilter::checkVar($_POST['mail_regd_min'], 'text'));
$regd_max_hidden = new icms_form_elements_Hidden("mail_regd_max", icms_core_DataFilter::checkVar($_POST['mail_regd_max'], 'text'));
$idle_more_hidden = new icms_form_elements_Hidden("mail_idle_more", icms_core_DataFilter::checkVar($_POST['mail_idle_more'], 'text'));
$idle_less_hidden = new icms_form_elements_Hidden("mail_idle_less", icms_core_DataFilter::checkVar($_POST['mail_idle_less'], 'text'));
$fname_hidden = new icms_form_elements_Hidden("mail_fromname", icms_core_DataFilter::checkVar($_POST['mail_fromname'], 'text'));
$femail_hidden = new icms_form_elements_Hidden("mail_fromemail", icms_core_DataFilter::checkVar($_POST['mail_fromemail'], 'text'));
$subject_hidden = new icms_form_elements_Hidden("mail_subject", icms_core_DataFilter::checkVar($_POST['mail_subject'], 'text'));
$body_hidden = new icms_form_elements_Hidden("mail_body", icms_core_DataFilter::checkVar($_POST['mail_body'], 'text'));
$start_hidden = new icms_form_elements_Hidden("mail_start", (int) $_POST['mail_start'] + $limit);
$mail_mailok_hidden = new icms_form_elements_Hidden("mail_mailok", icms_core_DataFilter::checkVar(@$_POST['mail_mailok']));
$op_hidden = new icms_form_elements_Hidden("op", "send");
$submit_button = new icms_form_elements_Button("", "mail_submit", _AM_SENDNEXT, "submit");
$sent_label = new icms_form_elements_Label(_AM_SENT, sprintf(_AM_SENTNUM, (int) $_POST['mail_start'] + 1, (int) $_POST['mail_start'] + $limit, $count_criteria + $added_count - $limit));
$form->addElement($sent_label);
$form->addElement($inactive_hidden);
$form->addElement($lastlog_min_hidden);
$form->addElement($lastlog_max_hidden);
$form->addElement($regd_min_hidden);
$form->addElement($regd_max_hidden);
$form->addElement($idle_more_hidden);
$form->addElement($idle_less_hidden);
$form->addElement($fname_hidden);
$form->addElement($femail_hidden);
$form->addElement($subject_hidden);
$form->addElement($body_hidden);
示例6: cleanVars
/**
* clean values of all variables of the object for storage.
* also add slashes whereever needed
*
* We had to put this method in the icms_ipf_Object because the XOBJ_DTYPE_ARRAY does not work properly
* at least on PHP 5.1. So we have created a new type XOBJ_DTYPE_SIMPLE_ARRAY to handle 1 level array
* as a string separated by |
*
* @return bool true if successful
* @access public
*/
public function cleanVars()
{
$existing_errors = $this->getErrors();
$this->_errors = array();
foreach ($this->vars as $k => $v) {
$cleanv = $v['value'];
if (!$v['changed'] || $this->_isNewConfig) {
} else {
$cleanv = is_string($cleanv) ? trim($cleanv) : $cleanv;
switch ($v['data_type']) {
case XOBJ_DTYPE_TXTBOX:
if ($v['required'] && $cleanv != '0' && $cleanv == '') {
$this->setErrors(sprintf(_XOBJ_ERR_REQUIRED, $k));
continue;
}
if (isset($v['maxlength']) && strlen($cleanv) > (int) $v['maxlength']) {
$this->setErrors(sprintf(_XOBJ_ERR_SHORTERTHAN, $k, (int) $v['maxlength']));
continue;
}
if (!$v['not_gpc']) {
$cleanv = icms_core_DataFilter::stripSlashesGPC(icms_core_DataFilter::censorString($cleanv));
} else {
$cleanv = icms_core_DataFilter::censorString($cleanv);
}
break;
case XOBJ_DTYPE_TXTAREA:
if ($v['required'] && $cleanv != '0' && $cleanv == '') {
$this->setErrors(sprintf(_XOBJ_ERR_REQUIRED, $k));
continue;
}
if (!$v['not_gpc']) {
$cleanv = icms_core_DataFilter::stripSlashesGPC($cleanv);
$cleanv = icms_core_DataFilter::checkVar($cleanv, 'html', 'input');
} else {
//$cleanv = icms_core_DataFilter::censorString($cleanv);
$cleanv = icms_core_DataFilter::checkVar($cleanv, 'html', 'input');
}
break;
case XOBJ_DTYPE_SOURCE:
if (!$v['not_gpc']) {
$cleanv = icms_core_DataFilter::stripSlashesGPC($cleanv);
} else {
$cleanv = $cleanv;
}
break;
case XOBJ_DTYPE_INT:
case XOBJ_DTYPE_TIME_ONLY:
$cleanv = (int) $cleanv;
break;
case XOBJ_DTYPE_CURRENCY:
$cleanv = icms_currency($cleanv);
break;
case XOBJ_DTYPE_FLOAT:
$cleanv = icms_float($cleanv);
break;
case XOBJ_DTYPE_EMAIL:
if ($v['required'] && $cleanv == '') {
$this->setErrors(sprintf(_XOBJ_ERR_REQUIRED, $k));
continue;
}
if ($cleanv != '' && !icms_core_DataFilter::checkVar($cleanv, 'email')) {
$this->setErrors(_CORE_DB_INVALIDEMAIL);
continue;
}
if (!$v['not_gpc']) {
$cleanv = icms_core_DataFilter::stripSlashesGPC($cleanv);
}
break;
case XOBJ_DTYPE_URL:
if ($v['required'] && $cleanv == '') {
$this->setErrors(sprintf(_XOBJ_ERR_REQUIRED, $k));
continue;
}
if ($cleanv != '' && !preg_match("/^http[s]*:\\/\\//i", $cleanv)) {
$cleanv = 'http://' . $cleanv;
}
if (!$v['not_gpc']) {
$cleanv = icms_core_DataFilter::stripSlashesGPC($cleanv);
}
break;
case XOBJ_DTYPE_SIMPLE_ARRAY:
$cleanv = implode('|', $cleanv);
break;
case XOBJ_DTYPE_ARRAY:
$cleanv = is_array($cleanv) ? serialize($cleanv) : $cleanv;
break;
case XOBJ_DTYPE_STIME:
case XOBJ_DTYPE_MTIME:
case XOBJ_DTYPE_LTIME:
//.........这里部分代码省略.........
示例7: userCheck
/**
* Validates username, email address and password entries during registration
* Username is validated for uniqueness and length
* password is validated for length and strictness
* email is validated as a proper email address pattern
*
* @param string $uname User display name entered by the user
* @param string $login_name Username entered by the user
* @param string $email Email address entered by the user
* @param string $pass Password entered by the user
* @param string $vpass Password verification entered by the user
* @param int $uid user id (only applicable if the user already exists)
* @global array $icmsConfigUser user configuration
* @return string of errors encountered while validating the user information, will be blank if successful
*/
public function userCheck($login_name, $uname, $email, $pass, $vpass, $uid = 0)
{
global $icmsConfigUser;
// initializations
$member_handler = icms::handler('icms_member');
$thisUser = $uid > 0 ? $thisUser = $member_handler->getUser($uid) : FALSE;
$icmsStopSpammers = new icms_core_StopSpammer();
$stop = '';
switch ($icmsConfigUser['uname_test_level']) {
case 0:
// strict
$restriction = '/[^a-zA-Z0-9\\_\\-]/';
break;
case 1:
// medium
$restriction = '/[^a-zA-Z0-9\\_\\-\\<\\>\\,\\.\\$\\%\\#\\@\\!\\\'\\"]/';
break;
case 2:
// loose
$restriction = '/[\\000-\\040]/';
break;
}
// check email
if (is_object($thisUser) && $thisUser->getVar('email', 'e') != $email && $email !== FALSE || !is_object($thisUser)) {
if (!icms_core_DataFilter::checkVar($email, 'email', 0, 1)) {
$stop .= _US_INVALIDMAIL . '<br />';
}
$count = $this->getCount(icms_buildCriteria(array('email' => addslashes($email))));
if ($count > 0) {
$stop .= _US_EMAILTAKEN . '<br />';
}
}
// check login_name
$login_name = icms_core_DataFilter::icms_trim($login_name);
if (is_object($thisUser) && $thisUser->getVar('login_name', 'e') != $login_name && $login_name !== FALSE || !is_object($thisUser)) {
if (empty($login_name) || preg_match($restriction, $login_name)) {
$stop .= _US_INVALIDNICKNAME . '<br />';
}
if (strlen($login_name) > $icmsConfigUser['maxuname']) {
$stop .= sprintf(_US_NICKNAMETOOLONG, $icmsConfigUser['maxuname']) . '<br />';
}
if (strlen($login_name) < $icmsConfigUser['minuname']) {
$stop .= sprintf(_US_NICKNAMETOOSHORT, $icmsConfigUser['minuname']) . '<br />';
}
foreach ($icmsConfigUser['bad_unames'] as $bu) {
if (!empty($bu) && preg_match('/' . $bu . '/i', $login_name)) {
$stop .= _US_NAMERESERVED . '<br />';
break;
}
}
if (strrpos($login_name, ' ') > 0) {
$stop .= _US_NICKNAMENOSPACES . '<br />';
}
$count = $this->getCount(icms_buildCriteria(array('login_name' => addslashes($login_name))));
if ($count > 0) {
$stop .= _US_LOGINNAMETAKEN . '<br />';
}
}
// check uname
if (is_object($thisUser) && $thisUser->getVar('uname', 'e') != $uname && $uname !== FALSE || !is_object($thisUser)) {
$count = $this->getCount(icms_buildCriteria(array('uname' => addslashes($uname))));
if ($count > 0) {
$stop .= _US_NICKNAMETAKEN . '<br />';
}
}
// check password
if ($pass !== FALSE) {
if (!isset($pass) || $pass == '' || !isset($vpass) || $vpass == '') {
$stop .= _US_ENTERPWD . '<br />';
}
if (isset($pass) && $pass != $vpass) {
$stop .= _US_PASSNOTSAME . '<br />';
} elseif ($pass != '' && strlen($pass) < $icmsConfigUser['minpass']) {
$stop .= sprintf(_US_PWDTOOSHORT, $icmsConfigUser['minpass']) . '<br />';
}
if (isset($pass) && isset($login_name) && ($pass == $login_name || $pass == icms_core_DataFilter::utf8_strrev($login_name, TRUE) || strripos($pass, $login_name) === TRUE)) {
$stop .= _US_BADPWD . '<br />';
}
}
// check other things
if ($icmsStopSpammers->badIP($_SERVER['REMOTE_ADDR'])) {
$stop .= _US_INVALIDIP . '<br />';
}
return $stop;
}
示例8: setConfValueForInput
/**
* Set a config value
*
* @param mixed &$value Value
* @param bool $force_slash
*/
public function setConfValueForInput($value, $force_slash = false)
{
if ($this->getVar('conf_formtype') == 'textarea' && $this->getVar('conf_valuetype') !== 'array') {
$value = icms_core_DataFilter::checkVar($value, 'html', 'input');
} elseif ($this->getVar('conf_formtype') == 'textsarea' && $this->getVar('conf_valuetype') !== 'array') {
$value = icms_core_DataFilter::checkVar($value, 'text', 'input');
} elseif ($this->getVar('conf_formtype') == 'password') {
$value = filter_var($value, FILTER_SANITIZE_URL);
} else {
$value = StopXSS($value);
}
switch ($this->getVar('conf_valuetype')) {
case 'array':
if (!is_array($value)) {
$value = explode('|', trim($value));
}
$this->setVar('conf_value', serialize($value), $force_slash);
break;
case 'text':
$this->setVar('conf_value', trim($value), $force_slash);
break;
default:
$this->setVar('conf_value', $value, $force_slash);
break;
}
}
示例9: getVar
//.........这里部分代码省略.........
break 1;
}
break;
case XOBJ_DTYPE_CURRENCY:
$decimal_section_original = strstr($ret, '.');
$decimal_section = $decimal_section_original;
if ($decimal_section) {
if (strlen($decimal_section) == 1) {
$decimal_section = '.00';
} elseif (strlen($decimal_section) == 2) {
$decimal_section = $decimal_section . '0';
}
$ret = str_replace($decimal_section_original, $decimal_section, $ret);
} else {
$ret = $ret . '.00';
}
break;
case XOBJ_DTYPE_TXTAREA:
switch (strtolower($format)) {
case 's':
case 'show':
$ts = icms_core_Textsanitizer::getInstance();
$html = !empty($this->vars['dohtml']['value']) ? 1 : 0;
$xcode = !isset($this->vars['doxcode']['value']) || $this->vars['doxcode']['value'] == 1 ? 1 : 0;
$smiley = !isset($this->vars['dosmiley']['value']) || $this->vars['dosmiley']['value'] == 1 ? 1 : 0;
$image = !isset($this->vars['doimage']['value']) || $this->vars['doimage']['value'] == 1 ? 1 : 0;
$br = !isset($this->vars['dobr']['value']) || $this->vars['dobr']['value'] == 1 ? 1 : 0;
if (defined('XOOPS_EDITOR_IS_HTML')) {
$br = false;
}
if ($html) {
return $ts->displayTarea($ret, $html, $smiley, $xcode, $image, $br);
} else {
return icms_core_DataFilter::checkVar($ret, 'text', 'output');
}
break 1;
case 'e':
case 'edit':
return htmlspecialchars($ret, ENT_QUOTES);
break 1;
case 'p':
case 'preview':
$ts = icms_core_Textsanitizer::getInstance();
$html = !empty($this->vars['dohtml']['value']) ? 1 : 0;
$xcode = !isset($this->vars['doxcode']['value']) || $this->vars['doxcode']['value'] == 1 ? 1 : 0;
$smiley = !isset($this->vars['dosmiley']['value']) || $this->vars['dosmiley']['value'] == 1 ? 1 : 0;
$image = !isset($this->vars['doimage']['value']) || $this->vars['doimage']['value'] == 1 ? 1 : 0;
$br = !isset($this->vars['dobr']['value']) || $this->vars['dobr']['value'] == 1 ? 1 : 0;
if ($html) {
return $ts->previewTarea($ret, $html, $smiley, $xcode, $image, $br);
} else {
return icms_core_DataFilter::checkVar($ret, 'text', 'output');
}
break 1;
case 'f':
case 'formpreview':
return htmlspecialchars(icms_core_DataFilter::stripSlashesGPC($ret), ENT_QUOTES);
break 1;
case 'n':
case 'none':
default:
break 1;
}
break;
case XOBJ_DTYPE_SIMPLE_ARRAY:
$ret =& explode('|', $ret);
示例10: BannerClientDelete
/**
* Deletes a client
* @param int $cid client id
*/
function BannerClientDelete($cid) {
global $icmsConfig, $icmsModule;
icms_cp_header();
$result = icms::$xoopsDB->query("SELECT cid, name FROM " . icms::$xoopsDB->prefix("bannerclient") . " WHERE cid='". (int) $cid . "'");
list($cid, $name) = icms::$xoopsDB->fetchRow($result);
$name = icms_core_DataFilter::htmlSpecialChars($name);
echo "<table width='100%' border='0' cellspacing='1' class='outer'><tr><td class=\"odd\">";
echo "<h4>" . _AM_DELEADC . "</h4>" . sprintf(_AM_SUREDELCLI, $name) . "<br /><br />";
$result2 = icms::$xoopsDB->query("SELECT imageurl, clickurl, htmlbanner, htmlcode FROM " . icms::$xoopsDB->prefix("banner") . " WHERE cid='". (int) $cid . "'");
$numrows = icms::$xoopsDB->getRowsNum($result2);
if ($numrows == 0) {
echo "" . _AM_NOBNRRUN . "<br /><br />";
} else {
echo "<font color='#ff0000'><strong>" . _AM_WARNING . "</strong></font><br />" . _AM_ACTBNRRUN . "<br /><br />";
}
while (list($imageurl, $clickurl, $htmlbanner, $htmlcode) = icms::$xoopsDB->fetchRow($result2)) {
$imageurl = htmlspecialchars($imageurl, ENT_QUOTES);
$clickurl = htmlspecialchars($clickurl, ENT_QUOTES);
$bannerobject = "";
if ($htmlbanner) {
$bannerobject = icms_core_DataFilter::checkVar($htmlcode, 'html', 'output');
} else {
$bannerobject = '<div><a href="' . $clickurl . '" rel="external">';
if (strtolower(substr($imageurl, strrpos($imageurl, ".")))==".swf") {
$bannerobject = $bannerobject;
echo '<object type="application/x-shockwave-flash" data="' . $imageurl . '" width="468" height="60">';
echo '<param name="movie" value="' . $imageurl . '" />';
echo '<param name="quality" value="high" />';
echo '</object>';
} else {
$bannerobject = $bannerobject . '<img src="' . $imageurl . '" alt="" />';
}
$bannerobject = $bannerobject . '</a></div>';
}
echo $bannerobject . "<a href='" . $clickurl . "'>" . $clickurl . "</a><br /><br />";
}
icms_core_Message::confirm(array('fct' => 'banners', 'op' => 'BannerClientDelete2', 'cid' => $cid), 'admin.php', _AM_SUREDELBNR);
echo "</td></tr></table>";
icms_cp_footer();
}
示例11: redirect_header
if (!icms::$user || !$icmsConfigUser['allow_chgmail']) {
redirect_header(ICMS_URL . '/modules/' . basename(dirname(__FILE__)), 3, _NOPERM);
}
$profile_template = 'profile_changemail.html';
include 'header.php';
if (!isset($_POST['submit']) && !isset($_REQUEST['oldmail'])) {
//show change password form
$form = new icms_form_Theme(_MD_PROFILE_CHANGEMAIL, 'form', $_SERVER['REQUEST_URI'], 'post', true);
$form->addElement(new icms_form_elements_Text(_MD_PROFILE_NEWMAIL, 'newmail', 15, 50), true);
$form->addElement(new icms_form_elements_Button('', 'submit', _SUBMIT, 'submit'));
$form->assign($icmsTpl);
} else {
//compute unique key
$key = md5(substr(icms::$user->getVar('pass'), 0, 5));
if (!isset($_REQUEST['oldmail'])) {
if (!icms_core_DataFilter::checkVar($_POST['newmail'], 'email', 0, 1)) {
redirect_header(ICMS_URL . '/modules/' . basename(dirname(__FILE__)) . 'changemail.php', 2, _MD_PROFILE_INVALIDMAIL);
}
//send email to new email address with key
$icmsMailer = new icms_messaging_Handler();
$icmsMailer->useMail();
$icmsMailer->setTemplateDir(ICMS_ROOT_PATH . '/modules/' . basename(dirname(__FILE__)) . '/language/' . $icmsConfig['language'] . '/mail_template');
$icmsMailer->setTemplate('changemail.tpl');
$icmsMailer->assign('SITENAME', $icmsConfig['sitename']);
$icmsMailer->assign('X_UNAME', icms::$user->getVar('uname'));
$icmsMailer->assign('ADMINMAIL', $icmsConfig['adminmail']);
$icmsMailer->assign('SITEURL', ICMS_URL);
$icmsMailer->assign('IP', $_SERVER['REMOTE_ADDR']);
$icmsMailer->assign('NEWEMAIL_LINK', ICMS_URL . '/modules/' . basename(dirname(__FILE__)) . '/changemail.php?code=' . $key . '&oldmail=' . icms::$user->getVar('email'));
$icmsMailer->assign('NEWEMAIL', $_POST['newmail']);
$icmsMailer->setToEmails($_POST['newmail']);
示例12: formatTimestamp
echo "<img src='uploads/" . $poster->getVar("user_avatar") . "' alt='' /><br />\n";
}
if ($poster->getVar("user_from") != "") {
echo _PM_FROMC . "" . $poster->getVar("user_from") . "<br /><br />\n";
}
if ($poster->isOnline()) {
echo "<span style='color:#ee0000;font-weight:bold;'>" . _PM_ONLINE . "</span><br /><br />\n";
}
} else {
echo $icmsConfig['anonymous'];
// we need to do this for deleted users
}
echo "</td><td><img src='images/subject/" . $pm_arr[0]->getVar("msg_image", "E") . "' alt='' /> \r\n\t\t\t" . _PM_SENTC . "" . formatTimestamp($pm_arr[0]->getVar("msg_time"));
echo "<hr /><b>" . $pm_arr[0]->getVar("subject") . "</b><br /><br />\n";
$var = $pm_arr[0]->getVar('msg_text', 'N');
echo icms_core_DataFilter::checkVar($var, 'html', 'output') . "<br /><br /></td></tr>\r\n\t\t\t<tr class='foot'><td width='20%' colspan='2' align='" . _GLOBAL_LEFT . "'>";
// we dont want to reply to a deleted user!
if ($poster != false) {
echo "<a href='#' onclick='javascript:openWithSelfMain(\"" . ICMS_URL . "/pmlite.php?reply=1&msg_id=" . $pm_arr[0]->getVar("msg_id") . "\",\"pmlite\",800,680);'>\r\n\t\t\t\t<img src='" . ICMS_URL . "/images/icons/" . $GLOBALS["icmsConfig"]["language"] . "/reply.gif' alt='" . _PM_REPLY . "' /></a>\n";
}
echo "<input type='hidden' name='delete' value='1' />";
echo icms::$security->getTokenHTML();
echo "<input type='hidden' name='msg_id' value='" . $pm_arr[0]->getVar("msg_id") . "' />";
echo "<a href='#" . $pm_arr[0]->getVar("msg_id") . "' onclick='javascript:document.delete" . $pm_arr[0]->getVar("msg_id") . ".submit();'>\r\n\t\t\t<img src='" . ICMS_URL . "/images/icons/" . $GLOBALS["icmsConfig"]["language"] . "/delete.gif' alt='" . _PM_DELETE . "' /></a>";
echo "</td></tr><tr><td colspan='2' align='" . _GLOBAL_RIGHT . "'>";
$previous = $start - 1;
$next = $start + 1;
if ($previous >= 0) {
echo "<a href='readpmsg.php?start=" . (int) $previous . "&total_messages=" . (int) $total_messages . "'>" . _PM_PREVIOUS . "</a> | ";
} else {
echo _PM_PREVIOUS . " | ";
示例13: redirect_header
$thisUser = icms::handler('icms_member')->getUser($uid);
if (!is_object($thisUser) || !$thisUser->isActive()) {
redirect_header('index.php', 3, _US_SELECTNG);
}
$xoopsOption['template_main'] = 'system_userinfo.html';
include ICMS_ROOT_PATH . '/header.php';
$icmsTpl->assign('user_ownpage', FALSE);
}
if (is_object(icms::$user) && $isAdmin) {
icms_makeSmarty(array('lang_editprofile' => _US_EDITPROFILE, 'lang_deleteaccount' => _US_DELACCOUNT, 'user_uid' => (int) $thisUser->getVar('uid')));
}
$userrank = $thisUser->rank();
$date = $thisUser->getVar('last_login');
icms_makeSmarty(array('user_avatarurl' => $icmsConfigUser['avatar_allow_gravatar'] == TRUE ? $thisUser->gravatar('G', $icmsConfigUser['avatar_width']) : ICMS_UPLOAD_URL . '/' . $thisUser->getVar('user_avatar'), 'user_websiteurl' => $thisUser->getVar('url', 'E') == '' ? '' : '<a href="' . $thisUser->getVar('url', 'E') . '" rel="external">' . $thisUser->getVar('url') . '</a>', 'lang_website' => _US_WEBSITE, 'user_realname' => $thisUser->getVar('name'), 'lang_realname' => _US_REALNAME, 'lang_avatar' => _US_AVATAR, 'lang_allaboutuser' => sprintf(_US_ALLABOUT, $thisUser->getVar('uname')), 'user_alwopenid' => $icmsConfigAuth['auth_openid'], 'lang_openid', $icmsConfigAuth['auth_openid'] == TRUE ? _US_OPENID_FORM_CAPTION : '', 'lang_email' => _US_EMAIL, 'lang_privmsg' => _US_PM, 'lang_icq' => _US_ICQ, 'user_icq' => $thisUser->getVar('user_icq'), 'lang_aim' => _US_AIM, 'user_aim' => $thisUser->getVar('user_aim'), 'lang_yim' => _US_YIM, 'user_yim' => $thisUser->getVar('user_yim'), 'lang_msnm' => _US_MSNM, 'user_msnm' => $thisUser->getVar('user_msnm'), 'lang_location' => _US_LOCATION, 'user_location' => $thisUser->getVar('user_from'), 'lang_occupation' => _US_OCCUPATION, 'user_occupation' => $thisUser->getVar('user_occ'), 'lang_interest' => _US_INTEREST, 'user_interest' => $thisUser->getVar('user_intrest'), 'lang_extrainfo' => _US_EXTRAINFO, 'user_extrainfo' => icms_core_DataFilter::checkVar($thisUser->getVar('bio', 'N'), 'text', 'output'), 'lang_statistics' => _US_STATISTICS, 'lang_membersince' => _US_MEMBERSINCE, 'user_joindate' => formatTimestamp($thisUser->getVar('user_regdate'), 's'), 'lang_rank' => _US_RANK, 'lang_posts' => _US_POSTS, 'lang_basicInfo' => _US_BASICINFO, 'lang_more' => _US_MOREABOUT, 'lang_myinfo' => _US_MYINFO, 'user_posts' => icms_conv_nr2local($thisUser->getVar('posts')), 'lang_lastlogin' => _US_LASTLOGIN, 'lang_notregistered' => _US_NOTREGISTERED, 'user_pmlink' => is_object(icms::$user) ? "<a href=\"javascript:openWithSelfMain('" . ICMS_URL . "/pmlite.php?send2=1&to_userid=" . (int) $thisUser->getVar('uid') . "', 'pmlite', 800,680);\"><img src=\"" . ICMS_URL . "/images/icons/" . $icmsConfig['language'] . "/pm.gif\" alt=\"" . sprintf(_SENDPMTO, $thisUser->getVar('uname')) . "\" /></a>" : '', 'user_rankimage' => $userrank['image'] ? '<img src="' . $userrank['image'] . '" alt="' . $userrank['title'] . '" />' : '', 'user_ranktitle' => $userrank['title'], 'user_lastlogin' => !empty($date) ? formatTimestamp($thisUser->getVar('last_login'), 'm') : '', 'icms_pagetitle' => sprintf(_US_ALLABOUT, $thisUser->getVar('uname')), 'user_email' => $thisUser->getVar('user_viewemail') == TRUE || is_object(icms::$user) && (icms::$user->isAdmin() || icms::$user->getVar('uid') == $thisUser->getVar('uid')) ? $thisUser->getVar('email', 'E') : ' ', 'user_openid' => $icmsConfigAuth['auth_openid'] == TRUE && ($thisUser->getVar('user_viewoid') == TRUE || is_object(icms::$user) && (icms::$user->isAdmin() || icms::$user->getVar('uid') == $thisUser->getVar('uid'))) ? $thisUser->getVar('openid', 'E') : ' '));
if ($icmsConfigUser['allwshow_sig'] == TRUE && strlen(trim($thisUser->getVar('user_sig', 'N'))) > 0) {
icms_makeSmarty(array('user_showsignature' => TRUE, 'lang_signature' => _US_SIGNATURE, 'user_signature' => icms_core_DataFilter::checkVar($thisUser->getVar('user_sig', 'N'), 'html', 'output')));
}
$module_handler = icms::handler('icms_module');
$criteria = new icms_db_criteria_Compo(new icms_db_criteria_Item('hassearch', 1));
$criteria->add(new icms_db_criteria_Item('isactive', 1));
$mids = array_keys($module_handler->getList($criteria));
foreach ($mids as $mid) {
if ($gperm_handler->checkRight('module_read', $mid, $groups)) {
$module = $module_handler->get($mid);
$results = $module->search('', '', 5, 0, (int) $thisUser->getVar('uid'));
$count = count($results);
if (is_array($results) && $count > 0) {
for ($i = 0; $i < $count; $i++) {
if (isset($results[$i]['image']) && $results[$i]['image'] != '') {
$results[$i]['image'] = 'modules/' . $module->getVar('dirname') . '/' . $results[$i]['image'];
} else {
示例14: icms_form_Theme
/**
* Get {@link icms_form_Theme} for registering new users
*
* @param object $user {@link icms_member_user_Object} to register
* @param int $step Which step we are at
* @param ProfileRegstep $next_step
*
* @return object
*/
function &getRegisterForm(&$user, $profile, $next_step = 0, $step)
{
$action = $_SERVER['REQUEST_URI'];
global $icmsConfigUser;
$reg_form = new icms_form_Theme($step->getVar('step_name'), "regform", $action, "post");
if ($step->getVar('step_intro') != "") {
$reg_form->addElement(new icms_form_elements_Label('', $step->getVar('step_intro')));
}
if ($next_step == 0) {
icms_loadLanguageFile('core', 'user');
$uname_size = $icmsConfigUser['maxuname'] < 75 ? $icmsConfigUser['maxuname'] : 75;
$elements[0][] = array('element' => new icms_form_elements_Text(_US_LOGIN_NAME, "login_name", $uname_size, 75, $user->getVar('login_name', 'e')), 'required' => true);
$weights[0][] = 0;
$elements[0][] = array('element' => new icms_form_elements_Text(_US_NICKNAME, "uname", $uname_size, 75, $user->getVar('uname', 'e')), 'required' => true);
$weights[0][] = 0;
$elements[0][] = array('element' => new icms_form_elements_Password(_MD_PROFILE_PASSWORD, "pass", 10, 32, "", false, $icmsConfigUser['pass_level'] ? 'password_adv' : ''), 'required' => true);
$weights[0][] = 0;
$elements[0][] = array('element' => new icms_form_elements_Password(_MD_PROFILE_VERIFYPASS, "vpass", 10, 32, ""), 'required' => true);
$weights[0][] = 0;
}
// Dynamic fields
$profile_handler = icms_getmodulehandler('profile', basename(dirname(dirname(__FILE__))), 'profile');
// Get fields
$fields = $profile_handler->loadFields();
foreach (array_keys($fields) as $i) {
// Set field persistance - load profile with session vars
$fieldname = $fields[$i]->getVar('field_name');
if (!empty($_SESSION['profile'][$fieldname]) && ($value = $_SESSION['profile'][$fieldname])) {
$profile->setVar($fieldname, $value);
}
if ($fields[$i]->getVar('step_id') == $step->getVar('step_id')) {
$fieldinfo['element'] = $fields[$i]->getEditElement($user, $profile);
$fieldinfo['required'] = $fields[$i]->getVar('field_required');
$key = $fields[$i]->getVar('catid');
$elements[$key][] = $fieldinfo;
$weights[$key][] = $fields[$i]->getVar('field_weight');
}
}
ksort($elements);
// Get categories
$cat_handler = icms_getmodulehandler('category', basename(dirname(dirname(__FILE__))), 'profile');
$categories = $cat_handler->getObjects(null, true, false);
foreach (array_keys($elements) as $k) {
array_multisort($weights[$k], SORT_ASC, array_keys($elements[$k]), SORT_ASC, $elements[$k]);
$title = isset($categories[$k]) ? $categories[$k]['cat_title'] : _MD_PROFILE_DEFAULT;
$desc = isset($categories[$k]) ? $categories[$k]['cat_description'] : "";
$reg_form->addElement(new icms_form_elements_Label($title, $desc), false);
foreach (array_keys($elements[$k]) as $i) {
$reg_form->addElement($elements[$k][$i]['element'], $elements[$k][$i]['required']);
}
}
//end of Dynamic User fields
if ($next_step == 0 && $icmsConfigUser['reg_dispdsclmr'] != 0 && $icmsConfigUser['reg_disclaimer'] != '') {
$disc_tray = new icms_form_elements_Tray(_MD_PROFILE_DISCLAIMER, '<br />');
$disc_text = new icms_form_elements_Label("", "<div id=\"disclaimer\">" . icms_core_DataFilter::checkVar($icmsConfigUser['reg_disclaimer'], 'html', 'output') . "</div>");
$disc_tray->addElement($disc_text);
$session_agreement = empty($_SESSION['profile']['agree_disc']) ? '' : $_SESSION['profile']['agree_disc'];
$agree_chk = new icms_form_elements_Checkbox('', 'agree_disc', $session_agreement);
$agree_chk->addOption(1, _MD_PROFILE_IAGREE);
$disc_tray->addElement($agree_chk);
$reg_form->addElement($disc_tray);
}
if ($next_step == 0 && $icmsConfigUser['use_captcha'] == 1) {
$reg_form->addElement(new icms_form_elements_Captcha(_SECURITYIMAGE_GETCODE, "scode"));
}
$reg_form->addElement(new icms_form_elements_Hidden("op", "step"));
$reg_form->addElement(new icms_form_elements_Hidden("step", $next_step));
$reg_form->addElement(new icms_form_elements_Button("", "submit", _MD_PROFILE_SUBMIT, "submit"));
return $reg_form;
}
示例15: bannerstats
/**
* Function to display the banners stats for
* each client
**/
function bannerstats()
{
global $icmsConfig, $icmsConfigMetaFooter, $icmsConfigPlugins;
if ($_SESSION['banner_login'] == '' || $_SESSION['banner_pass'] == '') {
redirect_header('banners.php', 2);
}
$result = icms::$xoopsDB->query(sprintf("SELECT cid, name, passwd FROM %s WHERE login=%s", icms::$xoopsDB->prefix('bannerclient'), icms::$xoopsDB->quoteString($_SESSION['banner_login'])));
list($cid, $name, $passwd) = icms::$xoopsDB->fetchRow($result);
if ($_SESSION['banner_pass'] == $passwd) {
include 'header.php';
echo "<div id='bannerstats'>" . "<h4 class='content_title'>" . sprintf(_BANNERS_TITLE, $name) . "</h4><hr />" . "<table summary=''>" . "<caption>" . sprintf(_BANNERS_TITLE, $name) . "</caption>" . "<thead><tr>" . "<td>ID</td>" . "<td>" . _BANNERS_IMP_MADE . "</td>" . "<td>" . _BANNERS_IMP_TOTAL . "</td>" . "<td>" . _BANNERS_IMP_LEFT . "</td>" . "<td>" . _BANNERS_CLICKS . "</td>" . "<td>" . _BANNERS_PER_CLICKS . "</td>" . "<td>" . _BANNERS_FUNCTIONS . "</td></tr></thead>" . "<tfoot><tr><td colspan='7'></td></tr></tfoot>";
$result = icms::$xoopsDB->query("select bid, imptotal, impmade, clicks, date from \r\n\t\t\t\t\t\t\t\t\t\t" . icms::$xoopsDB->prefix('banner') . " where cid='" . (int) $cid . "'");
$i = 0;
while (list($bid, $imptotal, $impmade, $clicks, $date) = icms::$xoopsDB->fetchRow($result)) {
if ($impmade == 0) {
$percent = 0;
} else {
$percent = substr(100 * $clicks / $impmade, 0, 5);
}
if ($imptotal == 0) {
$left = _BANNERS_UNLIMITED;
} else {
$left = $imptotal - $impmade;
}
$class = $i % 2 == 0 ? 'even' : 'odd';
echo "<tbody><tr class='{$class}'>" . "<td>{$bid}</td>" . "<td>{$impmade}</td>" . "<td>{$imptotal}</td>" . "<td>{$left}</td>" . "<td>{$clicks}</td>" . "<td>{$percent}%</td>" . "<td><a href='banners.php?op=EmailStats&cid={$cid}&bid={$bid}' title='" . _BANNERS_STATS . "'>" . _BANNERS_STATS . "</a></td></tr></tbody>";
$i++;
}
echo "</table><br /><br /><h4 class='content_title'>" . _BANNERS_FOW_IN . htmlspecialchars($icmsConfig['sitename']) . "</h4><hr />";
$result = icms::$xoopsDB->query("select bid, imageurl, clickurl, htmlbanner, htmlcode from \r\n\t\t\t\t\t\t\t\t\t\t" . icms::$xoopsDB->prefix('banner') . " where cid='" . (int) $cid . "'");
while (list($bid, $imageurl, $clickurl, $htmlbanner, $htmlcode) = icms::$xoopsDB->fetchRow($result)) {
$numrows = icms::$xoopsDB->getRowsNum($result);
if ($numrows > 1) {
echo "<br />";
}
if (!empty($htmlbanner) && !empty($htmlcode)) {
echo icms_core_DataFilter::checkVar($htmlcode, 'text', 'output');
} else {
if (strtolower(substr($imageurl, strrpos($imageurl, "."))) == ".swf") {
echo '<object type="application/x-shockwave-flash" data="' . $imageurl . '" width="468" height="60">' . '<param name=movie value="' . $imageurl . '" />' . '<param name="quality" value="high" />' . '</object>';
} else {
echo '<img src="' . $imageurl . '" alt="" />';
}
}
echo "<br /><strong>" . _BANNERS_ID . $bid . "</strong><br />" . sprintf(_BANNERS_SEND_STATS, 'banners.php?op=EmailStats&cid=' . $cid . '&bid=' . $bid) . "<br />";
if (!$htmlbanner) {
$clickurl = htmlspecialchars($clickurl, ENT_QUOTES);
echo sprintf(_BANNERS_POINTS, $clickurl) . "<br /><form action='banners.php' method='post'>" . _BANNERS_URL . "<input type='text' name='url' size='50' maxlength='200' value='{$clickurl}' />" . "<input type='hidden' name='bid' value='{$bid}' />" . "<input type='hidden' name='cid' value='{$cid}' />" . "<input type='submit' name='op' value='" . _BANNERS_CHANGE . "' />" . icms::$security->getTokenHTML("BANNER_EDIT") . "</form>";
}
}
/* Finished Banners */
echo "<br />";
if ($result = icms::$xoopsDB->query("select bid, impressions, clicks, datestart, dateend from\r\n\t\t\t" . icms::$xoopsDB->prefix('bannerfinish') . " where cid='" . (int) $cid . "'")) {
echo "<h4 class='content_title'>" . sprintf(_BANNERS_FINISHED, $name) . "</h4><hr /><table summary=''><caption>" . sprintf(_BANNERS_FINISHED, $name) . "</caption><thead><tr><td>ID</td><td>" . _BANNERS_IMP_MADE . "</td><td>" . _BANNERS_CLICKS . "</td><td>" . _BANNERS_PER_CLICKS . "</td><td>" . _BANNERS_STARTED . "</td><td>" . _BANNERS_ENDED . "</td></tr></thead>" . "<tfoot><tr><td colspan='6'></td></tr></tfoot>";
$i = 0;
while (list($bid, $impressions, $clicks, $datestart, $dateend) = icms::$xoopsDB->fetchRow($result)) {
$percent = substr(100 * $clicks / $impressions, 0, 5);
$class = $i % 2 == 0 ? 'even' : 'odd';
echo "<tbody><tr class='{$class}'>" . "<td>{$bid}</td>" . "<td>{$impressions}</td>" . "<td>{$clicks}</td>" . "<td>{$percent}%</td>" . "<td>" . formatTimestamp($datestart) . "</td>" . "<td>" . formatTimestamp($dateend) . "</td></tr></tbody>";
}
echo "</table></div>";
}
include 'footer.php';
} else {
redirect_header('banners.php', 2);
}
}