예제 #1
0
/**
 * @deprecated	This is not used anywhere in the core
 * @todo		Remove after 2.0
 * Displays smilie image buttons used to insert smilie codes to a target textarea in a form
 * $textarea_id is a unique of the target textarea
 */
function xoopsSmilies($textarea_id)
{
    icms_core_Debug::setDeprecated('icms_form_elements_Dhtmltextarea.', sprintf(_CORE_REMOVE_IN_VERSION, '2.0'));
    $smiles =& icms_core_DataFilter::getSmileys();
    if (empty($smileys)) {
        if ($result = icms::$xoopsDB->query("SELECT * FROM " . icms::$xoopsDB->prefix('smiles') . " WHERE display='1'")) {
            while ($smiles = icms::$xoopsDB->fetchArray($result)) {
                //hack smilies move for the smilies !!
                echo "<img src='" . ICMS_UPLOAD_URL . "/" . htmlspecialchars($smiles['smile_url']) . "' border='0' onmouseover='style.cursor=\"hand\"' alt='' onclick='xoopsCodeSmilie(\"" . $textarea_id . "_tarea\", \" " . $smiles['code'] . " \");' />";
                //fin du hack
            }
        }
    } else {
        $count = count($smiles);
        for ($i = 0; $i < $count; $i++) {
            if ($smiles[$i]['display'] == 1) {
                //hack bis
                echo "<img src='" . ICMS_UPLOAD_URL . "/" . icms_core_DataFilter::htmlSpecialChars($smiles['smile_url']) . "' border='0' alt='' onclick='xoopsCodeSmilie(\"" . $textarea_id . "_tarea\", \" " . $smiles[$i]['code'] . " \");' onmouseover='style.cursor=\"hand\"' />";
                //fin du hack
            }
        }
    }
    //hack for more
    echo "&nbsp;[<a href='#moresmiley' onmouseover='style.cursor=\"hand\"' alt='' onclick='openWithSelfMain(\"" . ICMS_URL . "/misc.php?action=showpopups&amp;type=smilies&amp;target=" . $textarea_id . "_tarea\",\"smilies\",300,475);'>" . _MORE . "</a>]";
}
예제 #2
0
/**
 * Logic and rendering for editing a smilie
 * 
 * @param int $id
 */
function SmilesEdit($id)
{
    $db =& icms_db_Factory::instance();
    icms_cp_header();
    echo '<a href="admin.php?fct=smilies">' . _AM_SMILESCONTROL . '</a>&nbsp;<span style="font-weight:bold;">&raquo;&raquo;</span>&nbsp;' . _AM_EDITSMILE . '<br /><br />';
    if ($getsmiles = $db->query("SELECT * FROM " . $db->prefix("smiles") . " WHERE id = '" . (int) $id . "'")) {
        $numsmiles = $db->getRowsNum($getsmiles);
        if ($numsmiles == 0) {
            //EMPTY
        } else {
            if ($smiles = $db->fetchArray($getsmiles)) {
                $smiles['smile_code'] = icms_core_DataFilter::htmlSpecialChars($smiles['code']);
                $smiles['smile_url'] = icms_core_DataFilter::htmlSpecialChars($smiles['smile_url']);
                $smiles['smile_desc'] = icms_core_DataFilter::htmlSpecialChars($smiles['emotion']);
                $smiles['smile_display'] = $smiles['display'];
                $smiles['smile_form'] = _AM_EDITSMILE;
                $smiles['op'] = 'SmilesSave';
                include ICMS_MODULES_PATH . '/system/admin/smilies/smileform.php';
                $smile_form->addElement(new icms_form_elements_Hidden('old_smile', $smiles['smile_url']));
                $smile_form->display();
            }
        }
    } else {
        echo _AM_CNRFTSD;
    }
    icms_cp_footer();
}
예제 #3
0
 /**
  * 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);
     }
 }
예제 #4
0
 /**
  * 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;
 }
/**
 * Highlights the passed source code as css
 *
 * @param $source
 */
function textsanitizer_geshi_css_highlight($source)
{
    if (!@(include_once ICMS_LIBRARIES_PATH . '/geshi/geshi.php')) {
        return false;
    }
    $source = icms_core_DataFilter::undoHtmlSpecialChars($source);
    // Create the new GeSHi object, passing relevant stuff
    $geshi = new GeSHi($source, 'css');
    // Enclose the code in a <div>
    $geshi->set_header_type(GESHI_HEADER_NONE);
    // Sets the proper encoding charset other than "ISO-8859-1"
    $geshi->set_encoding(_CHARSET);
    $geshi->set_link_target("_blank");
    // Parse the code
    $code = $geshi->parse_code();
    $code = "<div class=\"icmsCodeCss\"><code>" . $code . "</code></div>";
    return $code;
}
예제 #6
0
/**
 * Generates a pdf file
 *
 * @param string $content	The content to put in the PDF file
 * @param string $doc_title	The title for the PDF file
 * @param string $doc_keywords	The keywords to put in the PDF file
 * @return string Generated output by the pdf (@link TCPDF) class
 */
function Generate_PDF($content, $doc_title, $doc_keywords)
{
    global $icmsConfig;
    require_once ICMS_PDF_LIB_PATH . '/tcpdf.php';
    icms_loadLanguageFile('core', 'pdf');
    $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true);
    // set document information
    $pdf->SetCreator(PDF_CREATOR);
    $pdf->SetAuthor(PDF_AUTHOR);
    $pdf->SetTitle($doc_title);
    $pdf->SetSubject($doc_title);
    $pdf->SetKeywords($doc_keywords);
    $sitename = $icmsConfig['sitename'];
    $siteslogan = $icmsConfig['slogan'];
    $pdfheader = icms_core_DataFilter::undoHtmlSpecialChars($sitename . ' - ' . $siteslogan);
    $pdf->SetHeaderData("logo.gif", PDF_HEADER_LOGO_WIDTH, $pdfheader, ICMS_URL);
    //set margins
    $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
    //set auto page breaks
    $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
    $pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
    $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
    $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
    //set image scale factor
    $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
    $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
    $pdf->setLanguageArray($l);
    //set language items
    // set font
    $TextFont = @_PDF_LOCAL_FONT && file_exists(ICMS_PDF_LIB_PATH . '/fonts/' . _PDF_LOCAL_FONT . '.php') ? _PDF_LOCAL_FONT : 'dejavusans';
    $pdf->SetFont($TextFont);
    //initialize document
    $pdf->AliasNbPages();
    $pdf->AddPage();
    $pdf->writeHTML($content, true, 0);
    return $pdf->Output();
}
예제 #7
0
 /**
  * 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') . '&amp;topic_id=' . $this->getVar('topic_id') . '&amp;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') . '&amp;topic_id=' . $this->getVar('topic_id') . '&amp;op=deltribepost', $this->getDeleteItemLink(false, true, true));
     return $ret;
 }
예제 #8
0
 /**
  * prepare HTML for output of the smiley list.
  *
  * @return	string HTML
  */
 private function _renderSmileys()
 {
     $smiles =& icms_core_DataFilter::getSmileys();
     $ret = '';
     $count = count($smiles);
     $ele_name = $this->getName();
     for ($i = 0; $i < $count; $i++) {
         $ret .= "<img onclick='xoopsCodeSmilie(\"" . $ele_name . "_tarea\", \" " . $smiles[$i]['code'] . " \");' onmouseover='style.cursor=\"pointer\"' src='" . ICMS_UPLOAD_URL . "/" . htmlspecialchars($smiles[$i]['smile_url'], ENT_QUOTES) . "' border='0' alt='' />";
     }
     $ret .= "&nbsp;[<a href='#moresmiley' onclick='javascript:openWithSelfMain(\"" . ICMS_URL . "/misc.php?action=showpopups&amp;type=smilies&amp;target=" . $ele_name . "_tarea\",\"smilies\",300,475);'>" . _MORE . "</a>]";
     return $ret;
 }
예제 #9
0
/**
 * Shows information about the user
 *
 * @param array $options The block options
 * @return array $block the block array
 */
function b_system_info_show($options) {
	global $icmsConfig;
	$block = array();
	if (!empty($options[3])) {
		$block['showgroups'] = TRUE;
		$result = icms::$xoopsDB->query("SELECT u.uid, u.uname, u.email, u.user_viewemail, u.user_avatar, g.name AS groupname FROM " 
			. icms::$xoopsDB->prefix("groups_users_link") . " l LEFT JOIN " . icms::$xoopsDB->prefix("users") 
			. " u ON l.uid=u.uid LEFT JOIN " . icms::$xoopsDB->prefix("groups") 
			. " g ON l.groupid=g.groupid WHERE g.group_type='Admin' ORDER BY l.groupid, u.uid");
		if (icms::$xoopsDB->getRowsNum($result) > 0) {
			$prev_caption = "";
			$i = 0;
			while  ($userinfo = icms::$xoopsDB->fetchArray($result)) {
				if ($prev_caption != $userinfo['groupname']) {
					$prev_caption = $userinfo['groupname'];
					$block['groups'][$i]['name'] = icms_core_DataFilter::htmlSpecialChars($userinfo['groupname']);
				}
				if (isset(icms::$user) && is_object(icms::$user)) {
					$block['groups'][$i]['users'][] = array('id' => $userinfo['uid'], 'name' => icms_core_DataFilter::htmlSpecialChars($userinfo['uname']), 'msglink' => "<a href=\"javascript:openWithSelfMain('" . ICMS_URL . "/pmlite.php?send2=1&amp;to_userid=" . $userinfo['uid'] . "','pmlite',800,680);\"><img src=\"" . ICMS_URL . "/images/icons/" . $GLOBALS["icmsConfig"]["language"] . "/pm_small.gif\" width=\"27px\" height=\"17px\" alt=\"\" /></a>", 'avatar' => ICMS_UPLOAD_URL . '/' . $userinfo['user_avatar']);
				} else {
					if ($userinfo['user_viewemail']) {
						$block['groups'][$i]['users'][] = array('id' => $userinfo['uid'], 'name' => icms_core_DataFilter::htmlSpecialChars($userinfo['uname']), 'msglink' => '<a href="mailto:' . $userinfo['email'] . '"><img src="' . ICMS_URL . '/images/icons/' . $GLOBALS["icmsConfig"]["language"] . '/em_small.gif" width="16px" height="14px" alt="" /></a>', 'avatar' => ICMS_UPLOAD_URL . '/' . $userinfo['user_avatar']);
					} else {
						$block['groups'][$i]['users'][] = array('id' => $userinfo['uid'], 'name' => icms_core_DataFilter::htmlSpecialChars($userinfo['uname']), 'msglink' => '&nbsp;', 'avatar' => ICMS_UPLOAD_URL . '/' . $userinfo['user_avatar']);
					}
				}
				$i++;
			}
		}
	} else {
		$block['showgroups'] = FALSE;
	}
	$block['logourl'] = ICMS_URL . '/images/' . $options[2];
	$block['recommendlink'] = "<a href=\"javascript:openWithSelfMain('" 
		. ICMS_URL . "/misc.php?action=showpopups&amp;type=friend&amp;op=sendform&amp;t=" . time() 
		. "','friend'," . $options[0] . "," . $options[1] . ")\">" . _MB_SYSTEM_RECO . "</a>";
	return $block;
}
예제 #10
0
	/**
	 * Rendering a custom tag that contains PHP
	 */
	public function renderWithPhp() {
		if (!$this->content && !$this->evaluated) {
			$ret = $this->getVar('customtag_content', 'e');
			$ret = icms_core_DataFilter::undoHtmlSpecialChars($ret);

			// check for PHP if we are not on admin side
			if (!defined('XOOPS_CPFUNC_LOADED' ) && $this->getVar('customtag_type') == ICMS_CUSTOMTAG_TYPE_PHP) {
				// we have PHP code, let's evaluate
				ob_start();
				echo eval($ret);
				$ret = ob_get_contents();
				ob_end_clean();
				$this->evaluated = TRUE;
			}
			$this->content = $ret;
		}
		return $this->content;
	}
예제 #11
0
     $uid = (int) $_POST['uid'];
     $user = $member_handler->getUser($uid);
 } else {
     $user = $member_handler->createUser();
     $user->setVar('user_regdate', time());
     $user->setVar('user_avatar', 'blank.gif');
     $user->setVar('uorder', $icmsConfig['com_order']);
     $user->setVar('umode', $icmsConfig['com_mode']);
 }
 $errors = array();
 $stop = '';
 $login_name = isset($_POST['login_name']) ? trim($_POST['login_name']) : '';
 $uname = isset($_POST['uname']) ? trim($_POST['uname']) : '';
 $email = isset($_POST['email']) ? trim($_POST['email']) : '';
 $pass = isset($_POST['password']) ? icms_core_DataFilter::stripSlashesGPC($_POST['password']) : '';
 $vpass = isset($_POST['vpass']) ? icms_core_DataFilter::stripSlashesGPC($_POST['vpass']) : '';
 icms_loadLanguageFile('core', 'user');
 $stop .= icms::handler('icms_member_user')->userCheck($login_name, $uname, $email, !$user->isNew() && $pass == '' ? false : $pass, $vpass, $user->isNew() ? 0 : $user->getVar('uid'));
 if ($user->getVar('uid') != icms::$user->getVar('uid')) {
     if ($pass != '') {
         $icmspass = new icms_core_Password();
         $salt = icms_core_Password::createSalt();
         $pass = $icmspass->encryptPass($pass, $salt, $icmsConfigUser['enc_type']);
         $user->setVar('pass', $pass);
         $user->setVar('pass_expired', 0);
         $user->setVar('enc_type', $icmsConfigUser['enc_type']);
         $user->setVar('salt', $salt);
     }
     $user->setVar('level', (int) $_POST['level']);
 }
 $user->setVar('uname', $uname);
예제 #12
0
 /**
  * Returns a value for output of this field
  *
  * @param icms_member_user_Object $user object to get the value of
  * @param mod_profile_Profile $profile object to get the value of
  * @global array $icmsConfigAuth
  * @return mixed
  **/
 public function getOutputValue(&$user, $profile)
 {
     global $icmsConfigAuth;
     $value = in_array($this->getVar('field_name'), $this->getUserVars()) ? $user->getVar($this->getVar('field_name')) : $profile->getVar($this->getVar('field_name'));
     switch ($this->getVar('field_type')) {
         case "textarea":
         case "dhtml":
             return icms_core_DataFilter::undoHtmlSpecialChars(str_replace('&amp;', '&', $value), 1);
             break;
         case "select":
         case "radio":
             $options = unserialize($this->getVar('field_options', 'n'));
             return isset($options[$value]) ? htmlspecialchars($options[$value]) : "";
             break;
         case "select_multi":
         case "checkbox":
             $options = unserialize($this->getVar('field_options', 'n'));
             $ret = array();
             if (count($options) > 0) {
                 foreach (array_keys($options) as $key) {
                     if (in_array($key, $value)) {
                         $ret[$key] = htmlspecialchars($options[$key]);
                     }
                 }
             }
             return $ret;
             break;
         case "group":
             //change to retrieve groups and return name of group
             return $value;
             break;
         case "group_multi":
             //change to retrieve groups and return array of group names
             return "";
             break;
         case "longdate":
             //return YYYY/MM/DD format - not optimal as it is not using local date format, but how do we do that
             //when we cannot convert it to a UNIX timestamp?
             return str_replace("-", "/", $value);
         case "date":
             if ($value > 0) {
                 return formatTimestamp($value, 's');
             }
             return "";
             break;
         case "datetime":
             if ($value > 0) {
                 return formatTimestamp($value, 'm');
             }
             return "";
             break;
         case "autotext":
             $value = $user->getVar($this->getVar('field_name'), 'n');
             //autotext can have HTML in it
             $value = str_replace("{X_UID}", $user->getVar("uid"), $value);
             $value = str_replace("{X_URL}", ICMS_URL, $value);
             $value = str_replace("{X_UNAME}", $user->getVar("uname"), $value);
             return $value;
             break;
         case "rank":
             $userrank = $user->rank();
             return '<img src="' . $userrank['image'] . '" alt="' . $userrank['title'] . '" />&nbsp;' . $userrank['title'];
             break;
         case "yesno":
             return $value ? _YES : _NO;
             break;
         case "timezone":
             $timezones = icms_form_elements_select_Timezone::getTimeZoneList();
             return $timezones[str_replace('.0', '', $value)];
             break;
         case "image":
             if ($value == "") {
                 return '';
             }
             return "<img src='" . ICMS_UPLOAD_URL . "/" . basename(dirname(dirname(__FILE__))) . "/" . $value . "' alt='image' />";
             break;
         case "url":
             if ($value == "") {
                 return '';
             }
             return icms_core_DataFilter::makeClickable(formatURL($value));
         case "location":
             if ($value == "") {
                 return '';
             }
             return $value . '&nbsp;<a href="http://maps.google.com/?q=' . $value . '" target="_blank" ><img src="' . ICMS_URL . '/modules/' . basename(dirname(dirname(__FILE__))) . '/images/mapsgoogle.gif" alt="" /></a>';
         case "email":
             if ($value == "") {
                 return '';
             }
             if ($user->getVar('user_viewemail') || is_object(icms::$user) && (icms::$user->isAdmin() || icms::$user->getVar('uid') == $user->getVar('uid'))) {
                 return '<a href="mailto:' . $value . '">' . $value . '</a>';
             }
             return '';
         case "openid":
             if ($value == "") {
                 return '';
             }
             if ($icmsConfigAuth['auth_openid'] == 1 && ($user->getVar('user_viewoid') || is_object(icms::$user) && (icms::$user->isAdmin() || icms::$user->getVar('uid') == $user->getVar('uid')))) {
                 return $value;
             }
             return '';
         case "textbox":
         case "theme":
         case "language":
         default:
             return $value;
             break;
     }
 }
예제 #13
0
                 $xoopsMailer->setToEmails($toUser->getVar('email'));
                 if (icms::$user->getVar('user_viewemail')) {
                     $xoopsMailer->setFromEmail(icms::$user->getVar('email'));
                     $xoopsMailer->setFromName(icms::$user->getVar('uname'));
                 } else {
                     $xoopsMailer->setFromEmail($icmsConfig['adminmail']);
                     $xoopsMailer->setFromName($icmsConfig['sitename']);
                 }
                 $xoopsMailer->setTemplate('new_pm.tpl');
                 $xoopsMailer->assign('X_SITENAME', $icmsConfig['sitename']);
                 $xoopsMailer->assign('X_SITEURL', ICMS_URL . "/");
                 $xoopsMailer->assign('X_ADMINMAIL', $icmsConfig['adminmail']);
                 $xoopsMailer->assign('X_UNAME', $toUser->getVar('uname'));
                 $xoopsMailer->assign('X_FROMUNAME', icms::$user->getVar('uname'));
                 $xoopsMailer->assign('X_SUBJECT', icms_core_DataFilter::stripSlashesGPC($_POST['subject']));
                 $xoopsMailer->assign('X_MESSAGE', icms_core_DataFilter::stripSlashesGPC($_POST['message']));
                 $xoopsMailer->assign('X_ITEM_URL', ICMS_URL . "/viewpmsg.php");
                 $xoopsMailer->setSubject(sprintf(_PM_MESSAGEPOSTED_EMAILSUBJ, $icmsConfig['sitename']));
                 $xoopsMailer->send();
             }
             echo "<br /><br /><div style='text-align:center;'><h4>" . _PM_MESSAGEPOSTED . "</h4><br />\r\n\t\t\t\t\t<a href=\"javascript:window.opener.location='" . ICMS_URL . "/viewpmsg.php';window.close();\">" . _PM_CLICKHERE . "</a><br /><br />\r\n\t\t\t\t\t<a href=\"javascript:window.close();\">" . _PM_ORCLOSEWINDOW . "</a></div>";
         }
     }
 } elseif ($reply == 1 || $send == 1 || $send2 == 1) {
     if ($reply == 1) {
         $pm_handler = icms::handler('icms_data_privmessage');
         $pm =& $pm_handler->get($msg_id);
         if ($pm->getVar("to_userid") == (int) icms::$user->getVar('uid')) {
             $pm_uname = icms_member_user_Object::getUnameFromId($pm->getVar("from_userid"));
             $message = "[quote]\n";
             $message .= sprintf(_PM_USERWROTE, $pm_uname);
예제 #14
0
파일: main.php 프로젝트: nao-pon/impresscms
					$ele = new icms_form_elements_Colorpicker($title, $config[$i]->getVar('conf_name'), icms_core_DataFilter::htmlSpecialChars($config[$i]->getConfValueForOutput()));
					break;
						
				case 'hidden' :
					$ele = new icms_form_elements_Hidden($config[$i]->getVar('conf_name'), icms_core_DataFilter::htmlSpecialChars($config[$i]->getConfValueForOutput()));
					break;
						
				case 'select_pages' :
					$content_handler = & icms_getModuleHandler('content', 'content');
					$ele = new icms_form_elements_Select($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput());
					$ele->addOptionArray($content_handler->getContentList());
					break;
						
				case 'textbox' :
				default :
					$ele = new icms_form_elements_Text($title, $config[$i]->getVar('conf_name'), 50, 255, icms_core_DataFilter::htmlSpecialChars($config[$i]->getConfValueForOutput()));
					break;
			}
			$hidden = new icms_form_elements_Hidden('conf_ids[]', $config[$i]->getVar('conf_id'));
			$form->addElement($ele);
			$form->addElement($hidden);
			unset($ele, $hidden);
		}
		$form->addElement(new icms_form_elements_Hidden('op', 'save'));
		$form->addElement(new icms_form_elements_Button('', 'button', _GO, 'submit'));
		icms_cp_header();
		if ($module->getInfo('hasAdmin') == TRUE) {
			$modlink = '<a href="' . ICMS_MODULES_URL . '/' . $module->getVar('dirname') . '/' . $module->getInfo('adminindex') . '">' . $modname . '</a>';
		} else {
			$modlink = $modname;
		}
예제 #15
0
             $salt = icms_core_Password::createSalt();
             $pass = $icmspass->encryptPass($pass, $salt, $icmsConfigUser['enc_type']);
             $edituser->setVar('pass', $pass);
             $edituser->setVar('pass_expired', 0);
             $edituser->setVar('enc_type', $icmsConfigUser['enc_type']);
             $edituser->setVar('salt', $salt);
         }
         $edituser->setVar('level', (int) $_POST['level']);
     }
 } else {
     if ($icmsConfigUser['allow_chguname'] == 1) {
         $edituser->setVar('uname', $uname);
     }
 }
 if ($icmsConfigAuth['auth_openid'] == 1) {
     $edituser->setVar('openid', icms_core_DataFilter::stripSlashesGPC(trim($_POST['openid'])));
     $edituser->setVar('user_viewoid', isset($_POST['user_viewoid']) ? (int) $_POST['user_viewoid'] : 0);
 }
 // ALTERED BY FREEFORM SOLUTIONS TO SUPPORT USERS CHANGING THEIR OWN PASSWORDS FROM A SINGLE PROFILE PAGE
 // A REPEAT OF THE CODE BLOCK JUST ABOVE, TO HANDLE THE CASE WHERE THE USER IS UPDATING THEIR OWN PASSWORD
 if ($pass != '' and $edituser->getVar('uid') == icms::$user->getVar('uid')) {
     $icmspass = new icms_core_Password();
     $salt = icms_core_Password::createSalt();
     $pass = $icmspass->encryptPass($pass, $salt, $icmsConfigUser['enc_type']);
     $edituser->setVar('pass', $pass);
     $edituser->setVar('pass_expired', 0);
     $edituser->setVar('enc_type', $icmsConfigUser['enc_type']);
     $edituser->setVar('salt', $salt);
 }
 // Dynamic fields
 $profile_handler = icms_getmodulehandler('profile', basename(dirname(__FILE__)), 'profile');
예제 #16
0
<?php
/**
 * Privacy policy display page
 *
 * This page displays the privacy policy of the site
 *
 * @copyright	The ImpressCMS Project http://www.impresscms.org/
 * @license		http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU General Public License (GPL)
 * @package		core
 * @since		1.0
 * @author		m0nty_
 * @version		$Id: privpolicy.php 11072 2011-03-14 15:52:14Z m0nty_ $
 */

$xoopsOption['pagetype'] = 'privpolicy';
include 'mainfile.php';
if ($icmsConfigUser['priv_dpolicy'] == false) {
	redirect_header('index.php', 2, _US_NOPERMISS);
}

$xoopsOption['template_main'] = 'system_privpolicy.html';
include ICMS_ROOT_PATH.'/header.php';

$xoopsTpl->assign('priv_poltype', 'page');
$priv = str_replace('{X_SITEURL}', ICMS_URL.'/', $icmsConfigUser['priv_policy']);
$priv = str_replace('{X_SITENAME}', $icmsConfig['sitename'], $priv);
$priv = icms_core_DataFilter::checkVar($priv, 'html', 'output');
$xoopsTpl->assign('priv_policy', $priv);
$xoopsTpl->assign('lang_privacy_policy', _PRV_PRIVACY_POLICY);

include ICMS_ROOT_PATH.'/footer.php';
예제 #17
0
 *
 * @copyright	http://www.xoops.org/ The XOOPS Project
 * @copyright	XOOPS_copyrights.txt
 * @copyright	http://www.impresscms.org/ The ImpressCMS Project
 * @license	LICENSE.txt
 * @package		Administration
 * @subpackage	Comments
 * @since	XOOPS
 * @author	http://www.xoops.org The XOOPS Project
 * @author	modified by UnderDog <*****@*****.**>
 * @version		SVN: $Id: commentform.inc.php 20768 2011-02-06 00:02:25Z skenow $
 */
defined("ICMS_ROOT_PATH") || die("ImpressCMS root path not defined");
$cform = new icms_form_Theme(_CM_POSTCOMMENT, "commentform", "postcomment.php", "post", true);
if (!preg_match("/^re:/i", $subject)) {
    $subject = "Re: " . icms_core_DataFilter::icms_substr($subject, 0, 56);
}
$cform->addElement(new icms_form_elements_Text(_CM_TITLE, 'subject', 50, 255, $subject), true);
$icons_radio = new icms_form_elements_Radio(_MESSAGEICON, 'icon', $icon);
$subject_icons = icms_core_Filesystem::getFileList(ICMS_ROOT_PATH . "/images/subject/", '', array('gif', 'jpg', 'png'));
foreach ($subject_icons as $iconfile) {
    $icons_radio->addOption($iconfile, '<img src="' . ICMS_IMAGES_URL . '/subject/' . $iconfile . '" alt="" />');
}
$cform->addElement($icons_radio);
$cform->addElement(new icms_form_elements_Dhtmltextarea(_CM_MESSAGE, 'message', $message, 10, 50), true);
$option_tray = new icms_form_elements_Tray(_OPTIONS, '<br />');
if (icms::$user) {
    if ($icmsConfig['anonpost'] == true) {
        $noname_checkbox = new icms_form_elements_Checkbox('', 'noname', $noname);
        $noname_checkbox->addOption(1, _POSTANON);
        $option_tray->addElement($noname_checkbox);
예제 #18
0
icms_loadLanguageFile('core', 'user');
$uname = !isset($_POST['uname']) ? '' : trim($_POST['uname']);
$pass = !isset($_POST['pass']) ? '' : trim($_POST['pass']);
/**
 * Commented out for OpenID , we need to change it to make a better validation if OpenID is used
 */
/*if ($uname == '' || $pass == '') {
 redirect_header(ICMS_URL.'/user.php', 1, _US_INCORRECTLOGIN);
 exit();
 }*/
$member_handler = icms::handler('icms_member');
icms_loadLanguageFile('core', 'auth');
$icmsAuth =& icms_auth_Factory::getAuthConnection(icms_core_DataFilter::addSlashes($uname));
// uname&email hack GIJ
$uname4sql = addslashes(icms_core_DataFilter::stripSlashesGPC($uname));
$pass4sql = addslashes(icms_core_DataFilter::stripSlashesGPC($pass));
/*if (strstr( $uname , '@' )) {
 // check by email if uname includes '@'
 $criteria = new icms_db_criteria_Compo(new icms_db_criteria_Item('email', $uname4sql ));
 $criteria->add(new icms_db_criteria_Item('pass', $pass4sql));
 $user_handler = icms::handler('icms_member_user');
 $users =& $user_handler->getObjects($criteria, false);
 if (empty( $users ) || count( $users ) != 1 ) $user = false ;
 else $user = $users[0] ;
 unset( $users ) ;
 } */
if (empty($user) || !is_object($user)) {
    $user =& $icmsAuth->authenticate($uname4sql, $pass4sql);
}
// end of uname&email hack GIJ
if (false != $user) {
예제 #19
0
 * @license		LICENSE.txt
 * @package		Member
 * @subpackage	Users
 * @author		marcan <*****@*****.**>
 * @author	    Sina Asghari (aka stranger) <*****@*****.**>
 * @version		$Id: invite.php 21047 2011-03-14 15:52:14Z m0nty_ $
 */
$xoopsOption['pagetype'] = 'user';
include 'mainfile.php';
// If not a user and invite needs one, redirect
if ($icmsConfigUser['activation_type'] == 3 && $icmsConfigUser['allow_register'] == 0 && !is_object(icms::$user)) {
    redirect_header('index.php', 6, _US_INVITEBYMEMBER);
    exit;
}
$op = !isset($_POST['op']) ? 'invite' : $_POST['op'];
$email = isset($_POST['email']) ? trim(icms_core_DataFilter::stripSlashesGPC($_POST['email'])) : '';
switch ($op) {
    case 'finish':
        include 'header.php';
        $stop = '';
        if (!icms::$security->check()) {
            $stop .= implode('<br />', icms::$security->getErrors()) . "<br />";
        }
        $icmsCaptcha = icms_form_elements_captcha_Object::instance();
        if (!$icmsCaptcha->verify()) {
            $stop .= $icmsCaptcha->getMessage() . '<br />';
        }
        if (!checkEmail($email)) {
            $stop .= _US_INVALIDMAIL . '<br />';
        }
        if (empty($stop)) {
예제 #20
0
파일: main.php 프로젝트: nao-pon/impresscms
			}
		} else {
			$err = implode('<br />', $uploader->getErrors(FALSE));
			echo $err;
		}
		echo '</code><br /><a href="admin.php?fct=tplsets">' . _MD_AM_BTOTADMIN . '</a>';
		icms_cp_footer();
		break;

	case 'previewtpl':
		if (!icms::$security->check()) {
			redirect_header('admin.php?fct=tplsets', 3, implode('<br />', icms::$security->getErrors()));
		}

			
		$html = icms_core_DataFilter::stripSlashesGPC($html);
		$tpltpl_handler =& icms::handler('icms_view_template_file');
		$tplfile =& $tpltpl_handler->get($id, TRUE);
		$xoopsTpl = new icms_view_Tpl();

		if (is_object($tplfile)) {
			$dummylayout = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'
			. '<html><head><meta http-equiv="content-type" content="text/html; charset=' . _CHARSET 
			. '" /><meta http-equiv="content-language" content="' . _LANGCODE 
			. '" /><title>' . $icmsConfig['sitename'] . '</title>'
			. '<link rel="stylesheet" type="text/css" media="screen" href="' . ICMS_URL . '/icms' 
				. (( defined('_ADM_USE_RTL') && _ADM_USE_RTL ) 
					? '_rtl'
					:'') 
				. '.css" /><link rel="stylesheet" type="text/css" media="screen" href="' 
				. xoops_getcss($icmsConfig['theme_set']) . '" />';
예제 #21
0
/**
 * The listing of the images for the image manager
 * @param   int   $imgcat_id  The imageCatID to get the listing for
 * @param   int   $start      The start offset to get the listing for
 * @return  string            the fetched and construced template
 */
function imanager_listimg($imgcat_id, $start = 0) {
	global $icmsTpl, $target, $type;

	if (!is_object(icms::$user)) {
		$groups = array(XOOPS_GROUP_ANONYMOUS);
		$admin = FALSE;
	} else {
		$groups =& icms::$user->getGroups();
		$admin = (!icms::$user->isAdmin(1)) ? FALSE : TRUE;
	}

	$query = isset($_POST['query']) ? $_POST['query'] : NULL;

	if ($imgcat_id <= 0) {
		redirect_header($_SERVER['SCRIPT_NAME'] . '?op=list&target=' . $target . '&type=' . $type, 1, '');
	}
	$imgcat_handler = icms::handler('icms_image_category');
	$imagecategory =& $imgcat_handler->get($imgcat_id);
	$categ_path = $imgcat_handler->getCategFolder($imagecategory);
	$categ_url  = $imgcat_handler->getCategFolder($imagecategory, 1, 'url');
	if (!is_object($imagecategory)) {
		redirect_header($_SERVER['SCRIPT_NAME'] . '?op=list&target=' . $target . '&type=' . $type, 1);
	}

	$icmsTpl->assign('admnav', adminNav($imgcat_id, '/', 1));
	$icmsTpl->assign('lang_imanager_title', _IMGMANAGER);
	$icmsTpl->assign('lang_imanager_catmsize', _MD_IMAGECATMSIZE);
	$icmsTpl->assign('lang_imanager_catmwidth', _MD_IMAGECATMWIDTH);
	$icmsTpl->assign('lang_imanager_catmheight', _MD_IMAGECATMHEIGHT);
	$icmsTpl->assign('lang_imanager_catstype', _MD_IMAGECATSTYPE);
	$icmsTpl->assign('lang_imanager_catdisp', _MD_IMAGECATDISP);
	$icmsTpl->assign('lang_imanager_catsubs', _MD_IMAGECATSUBS);
	$icmsTpl->assign('lang_imanager_catqtde', _MD_IMAGECATQTDE);
	$icmsTpl->assign('lang_imanager_catoptions', _MD_IMAGECATOPTIONS);

	$icmsTpl->assign('lang_imanager_cat_edit', _EDIT);
	$icmsTpl->assign('lang_imanager_cat_clone', _CLONE);
	$icmsTpl->assign('lang_imanager_cat_del', _DELETE);
	$icmsTpl->assign('lang_imanager_cat_listimg', _LIST);
	$icmsTpl->assign('lang_imanager_cat_submit', _SUBMIT);
	$icmsTpl->assign('lang_imanager_cat_back', _BACK);
	$icmsTpl->assign('lang_imanager_cat_addimg', _ADDIMAGE);

	$icmsTpl->assign('lang_imanager_cat_addnewcat', _MD_ADDIMGCATBTN);
	$icmsTpl->assign('lang_imanager_cat_addnewimg', _MD_ADDIMGBTN);

	$icmsTpl->assign('cat_maxsize', icms_convert_size($imagecategory->getVar('imgcat_maxsize')));
	$icmsTpl->assign('cat_maxwidth', $imagecategory->getVar('imgcat_maxwidth'));
	$icmsTpl->assign('cat_maxheight', $imagecategory->getVar('imgcat_maxheight'));
	$icmsTpl->assign('cat_storetype', $imagecategory->getVar('imgcat_storetype'));
	$icmsTpl->assign('cat_display', $imagecategory->getVar('imgcat_display'));
	$icmsTpl->assign('cat_id', $imagecategory->getVar('imgcat_id'));

	$criteriaRead = new icms_db_criteria_Compo();
	if (is_array($groups) && !empty($groups)) {
		$criteriaTray = new icms_db_criteria_Compo();
		foreach ($groups as $gid) {
			$criteriaTray->add(new icms_db_criteria_Item('gperm_groupid', $gid), 'OR');
		}
		$criteriaRead->add($criteriaTray);
		$criteriaRead->add(new icms_db_criteria_Item('gperm_name', 'imgcat_read'));
		$criteriaRead->add(new icms_db_criteria_Item('gperm_modid', 1));
	}
	$criteriaRead->add(new icms_db_criteria_Item('imgcat_pid', $imagecategory->getVar('imgcat_id')));
	$subcats = $imgcat_handler->getObjects($criteriaRead);
	$subs  = count($subcats);
	$icmsTpl->assign('cat_subs', $subs);

	$image_handler = icms::handler('icms_image');

	$criteriaRead = new icms_db_criteria_Compo();
	if (is_array($groups) && !empty($groups)) {
		$criteriaTray = new icms_db_criteria_Compo();
		foreach ($groups as $gid) {
			$criteriaTray->add(new icms_db_criteria_Item('gperm_groupid', $gid), 'OR');
		}
		$criteriaRead->add($criteriaTray);
		$criteriaRead->add(new icms_db_criteria_Item('gperm_name', 'imgcat_read'));
		$criteriaRead->add(new icms_db_criteria_Item('gperm_modid', 1));
	}
	$id = (!is_null($imgcat_id) ? $imgcat_id : 0);
	$criteriaRead->add(new icms_db_criteria_Item('imgcat_pid', $imagecategory->getVar('imgcat_id')));
	$ssubs = $imgcat_handler->getObjects($criteriaRead);
	$sc = 0;
	foreach ($ssubs as $id=>$va) {
		$sc += $image_handler->getCount(new icms_db_criteria_Item('imgcat_id', $va->getVar('imgcat_id')));
	}
	$scount = $sc;
	$icmsTpl->assign('simgcount', $scount);

	$icmsTpl->assign('lang_imanager_img_preview', _PREVIEW);

	$icmsTpl->assign('lang_image_name', _IMAGENAME);
	$icmsTpl->assign('lang_image_mimetype', _IMAGEMIME);
	$icmsTpl->assign('lang_image_cat', _IMAGECAT);
	$icmsTpl->assign('lang_image_weight', _IMGWEIGHT);
	$icmsTpl->assign('lang_image_disp', _IMGDISPLAY);
	$icmsTpl->assign('lang_submit', _SUBMIT);
	$icmsTpl->assign('lang_cancel', _CANCEL);
	$icmsTpl->assign('lang_yes', _YES);
	$icmsTpl->assign('lang_no', _NO);
	$icmsTpl->assign('lang_search', _SEARCH);
	$icmsTpl->assign('lang_select', _SELECT);
	$icmsTpl->assign('lang_search_title', _QSEARCH);

	$icmsTpl->assign('lang_imanager_img_editor', 'DHTML Image Editor');

	$icmsTpl->assign('icms_root_path', ICMS_ROOT_PATH);
	$icmsTpl->assign('query', $query);
	$icmsTpl->assign('target', $target);
	$icmsTpl->assign('type', $type);

	$image_handler = icms::handler('icms_image');
	$criteria = new icms_db_criteria_Compo(new icms_db_criteria_Item('imgcat_id', $imgcat_id));
	if (!is_null($query)) {
		$criteria->add(new icms_db_criteria_Item('image_nicename', $query . '%', 'LIKE'));
	}
	$imgcount = $image_handler->getCount($criteria);
	$criteria->setStart($start);
	$criteria->setOrder('DESC');
	$criteria->setSort('image_weight');
	$criteria->setLimit(15);
	$images =& $image_handler->getObjects($criteria, TRUE, TRUE);

	$icmsTpl->assign('imgcount', $imgcount);

	$arrimg = array();
	foreach (array_keys($images) as $i) {
		$arrimg[$i]['id'] = $images[$i]->getVar('image_id');
		$arrimg[$i]['name'] = $images[$i]->getVar('image_name');
		$arrimg[$i]['nicename'] = $images[$i]->getVar('image_nicename');
		$arrimg[$i]['mimetype'] = $images[$i]->getVar('image_mimetype');
		$arrimg[$i]['weight'] = $images[$i]->getVar('image_weight');
		$arrimg[$i]['display'] = $images[$i]->getVar('image_display');
		$arrimg[$i]['categ_id'] = $images[$i]->getVar('imgcat_id');
		$arrimg[$i]['display_nicename'] = icms_core_DataFilter::icms_substr($images[$i]->getVar('image_nicename'), 0, 20);

		$uniq = icms_random_str(5);

		if ($imagecategory->getVar('imgcat_storetype') == 'db') {
			$src = ICMS_MODULES_URL . "/system/admin/images/preview.php?file=" . $images[$i]->getVar('image_name') . '&resize=0';
			$img = WideImage::load($images[$i]->getVar('image_body'))->saveToFile(ICMS_IMANAGER_FOLDER_PATH . '/' . $images[$i]->getVar('image_name'));
			$arrimg[$i]['size'] = icms_convert_size(filesize(ICMS_IMANAGER_FOLDER_PATH . '/' . $images[$i]->getVar('image_name')));
			$img_info = WideImage::load(ICMS_IMANAGER_FOLDER_PATH . '/' . $images[$i]->getVar('image_name'));
			$arrimg[$i]['width'] = $img_info->getWidth();
			$arrimg[$i]['height'] = $img_info->getHeight();
			@unlink(ICMS_IMANAGER_FOLDER_PATH . '/' . $images[$i]->getVar('image_name'));
			$path = ICMS_IMANAGER_FOLDER_PATH . '/';
			$arrimg[$i]['lcode'] = '[img align=left id=' . $images[$i]->getVar('image_id') . ']' . $images[$i]->getVar('image_nicename') . '[/img]';
			$arrimg[$i]['code'] = '[img align=center id=' . $images[$i]->getVar('image_id') . ']' . $images[$i]->getVar('image_nicename') . '[/img]';
			$arrimg[$i]['rcode'] = '[img align=right id=' . $images[$i]->getVar('image_id') . ']' . $images[$i]->getVar('image_nicename') . '[/img]';
		} else {
			$url = (substr($categ_url, -1) != '/') ? $categ_url . '/' : $categ_url;
			$path = (substr($categ_path, -1) != '/') ? $categ_path . '/' : $categ_path;
			$src = $url . $images[$i]->getVar('image_name');
			$arrimg[$i]['size'] = icms_convert_size(filesize($path . $images[$i]->getVar('image_name')));
			$img_info = WideImage::load($path . $images[$i]->getVar('image_name'));
			$arrimg[$i]['width'] = $img_info->getWidth();
			$arrimg[$i]['height'] = $img_info->getHeight();
			$arrimg[$i]['lcode'] = '[img align=left]' . $url . $images[$i]->getVar('image_name') . '[/img]';
			$arrimg[$i]['code'] = '[img align=center]' . $url . $images[$i]->getVar('image_name') . '[/img]';
			$arrimg[$i]['rcode'] = '[img align=right]' . $url . $images[$i]->getVar('image_name') . '[/img]';
		}
		$arrimg[$i]['src'] = $src . '?' . time();
		$arrimg[$i]['url_src'] = str_replace(ICMS_URL, '', $src);
		$src_lightbox = ICMS_MODULES_URL . "/system/admin/images/preview.php?file=" . $images[$i]->getVar('image_name');
		$preview_url = '<a href="' . $src_lightbox . '" rel="lightbox[categ' . $images[$i]->getVar('imgcat_id') . ']" title="' . $images[$i]->getVar('image_nicename') . '"><img src="'. ICMS_IMAGES_SET_URL . '/actions/viewmag.png" alt="' . _PREVIEW . '" title="' . _PREVIEW . '" /></a>';
		$arrimg[$i]['preview_link'] = $preview_url;

		$extra_perm = array("image/jpeg", "image/jpeg", "image/png", "image/gif");
		if (in_array($images[$i]->getVar('image_mimetype'), $extra_perm)) {
			$arrimg[$i]['hasextra_link'] = 1;
			if (file_exists(ICMS_LIBRARIES_PATH . '/image-editor/image-edit.php')) {
				$arrimg[$i]['editor_link'] = 'window.open(\'' . ICMS_LIBRARIES_URL . '/image-editor/image-edit.php?image_id=' . $images[$i]->getVar('image_id') . '&uniq=' . $uniq . '&target=' . $target . '&type=' . $type . '\', \'icmsDHTMLImageEditor\',\'width=800,height=600,left=\'+parseInt(screen.availWidth/2-400)+\',top=\'+parseInt(screen.availHeight/2-350)+\',resizable=no,location=no,menubar=no,status=no,titlebar=no,scrollbars=no\'); return FALSE;';
			} else {
				$arrimg[$i]['editor_link'] = '';
			}
		} else {
			$arrimg[$i]['hasextra_link'] = 0;
		}

		$list =& $imgcat_handler->getList(array(), NULL, NULL, $imagecategory->getVar('imgcat_storetype'));
		$div = '';
		foreach ($list as $value => $name) {
			$sel = '';
			if ($value == $images[$i]->getVar('imgcat_id')) {
				$sel = ' selected="selected"';
			}
			$div .= '<option value="' . $value . '"' . $sel . '>' . $name . '</option>';
		}
		$arrimg[$i]['ed_selcat_options'] = $div;

		$arrimg[$i]['ed_token'] = icms::$security->getTokenHTML();
		$arrimg[$i]['clone_token'] = icms::$security->getTokenHTML();
	}

	$icmsTpl->assign('images', $arrimg);
	if ($imgcount > 0) {
		if ($imgcount > 15) {
			$nav = new icms_view_PageNav($imgcount, 15, $start, 'start', 'op=listimg&amp;imgcat_id=' . $imgcat_id . '&type=' . $type . '&target=' . $target);
			$icmsTpl->assign('pag', '<div class="img_list_info_panel" align="center">' . $nav->renderNav() . '</div>');
		} else {
			$icmsTpl->assign('pag', '');
		}
	} else {
		$icmsTpl->assign('pag', '');
	}
	$icmsTpl->assign('addimgform', showAddImgForm($imgcat_id));

	return $icmsTpl->fetch(ICMS_MODULES_PATH . '/system/templates/admin/images/system_popup_imagemanager_imglist.html');
}
예제 #22
0
 $oldpass = !empty($_POST['oldpass']) ? icms_core_DataFilter::stripSlashesGPC(trim($_POST['oldpass'])) : '';
 $vpass = !empty($_POST['vpass']) ? icms_core_DataFilter::stripSlashesGPC(trim($_POST['vpass'])) : '';
 if (empty($password) || empty($oldpass) || empty($vpass)) {
     $stop .= _MD_PROFILE_PROVIDEPWDS;
 } else {
     icms_loadLanguageFile('core', 'user');
     if (!$member_handler->loginUser(addslashes(icms::$user->getVar('login_name')), addslashes($oldpass))) {
         $stop .= _US_BADPWD . "<br />";
     }
     if (strlen($password) < $icmsConfigUser['minpass']) {
         $stop .= sprintf(_US_PWDTOOSHORT, $icmsConfigUser['minpass']) . "<br />";
     }
     if ($password != $vpass) {
         $stop .= _US_PASSNOTSAME . "<br />";
     }
     if ($password == $username || $password == icms_core_DataFilter::utf8_strrev($username, true) || strripos($password, $username) === true) {
         $stop .= _US_BADPWD;
     }
 }
 if ($stop != '') {
     redirect_header(PROFILE_URL . 'changepass.php', 2, $stop);
 } else {
     $icmspass = new icms_core_Password();
     $salt = icms_core_Password::createSalt();
     $pass = $icmspass->encryptPass($_POST['password'], $salt, $icmsConfigUser['enc_type']);
     icms::$user->setVar('salt', $salt, true);
     icms::$user->setVar('pass', $pass, true);
     icms::$user->setVar('enc_type', $icmsConfigUser['enc_type'], true);
     if ($member_handler->insertUser(icms::$user)) {
         redirect_header(PROFILE_URL . '/userinfo.php?uid=' . icms::$user->getVar('uid'), 2, _MD_PROFILE_PASSWORDCHANGED);
     } else {
예제 #23
0
파일: main.php 프로젝트: nao-pon/impresscms
						$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);
예제 #24
0
if ($icmsConfigUser['pass_level'] > 20) {
    icms_PasswordMeter();
}
$reg_form->addElement(new icms_form_elements_Password(_US_PASSWORD, "pass", 10, 255, icms_core_DataFilter::htmlSpecialChars($pass), false, $icmsConfigUser['pass_level'] ? 'password_adv' : ''), true);
$reg_form->addElement(new icms_form_elements_Password(_US_VERIFYPASS, "vpass", 10, 255, icms_core_DataFilter::htmlSpecialChars($vpass)), true);
$reg_form->addElement(new icms_form_elements_Text(_US_WEBSITE, "url", 25, 255, icms_core_DataFilter::htmlSpecialChars($url)));
$tzselected = $timezone_offset != "" ? $timezone_offset : $icmsConfig['default_TZ'];
$reg_form->addElement(new icms_form_elements_select_Timezone(_US_TIMEZONE, "timezone_offset", $tzselected));
//$reg_form->addElement($avatar_tray);
$reg_form->addElement(new icms_form_elements_Radioyn(_US_MAILOK, 'user_mailok', $user_mailok));
if ($icmsConfigUser['reg_dispdsclmr'] != 0 && $icmsConfigUser['reg_disclaimer'] != '') {
    $disc_tray = new icms_form_elements_Tray(_US_DISCLAIMER, '<br />');
    $disclaimer_html = '<div id="disclaimer">' . nl2br($icmsConfigUser['reg_disclaimer']) . '</div>';
    $disc_text = new icms_form_elements_Label('', $disclaimer_html, 'disclaimer');
    $disc_tray->addElement($disc_text);
    $agree_chk = new icms_form_elements_Checkbox('', 'agree_disc', $agree_disc);
    $agree_chk->addOption(1, _US_IAGREE);
    $eltname = $agree_chk->getName();
    $eltmsg = str_replace('"', '\\"', stripslashes(sprintf(_FORM_ENTER, _US_IAGREE)));
    $agree_chk->customValidationCode[] = "if (myform.{$eltname}.checked == false) { window.alert(\"{$eltmsg}\"); myform.{$eltname}.focus(); return false; }";
    $disc_tray->addElement($agree_chk, true);
    $reg_form->addElement($disc_tray);
}
$reg_form->addElement(new icms_form_elements_Hidden("actkey", icms_core_DataFilter::htmlSpecialChars($actkey)));
if ($icmsConfigUser['use_captcha'] == true) {
    $reg_form->addElement(new icms_form_elements_Captcha(_SECURITYIMAGE_GETCODE, "scode"), true);
    $reg_form->addElement(new icms_form_elements_Hidden("op", "finish"));
} else {
    $reg_form->addElement(new icms_form_elements_Hidden("op", "newuser"));
}
$reg_form->addElement(new icms_form_elements_Button("", "submit", _US_SUBMIT, "submit"));
예제 #25
0
/**
 * Function to reverse given text with utf-8 character sets
 *
 * credit for this function should goto lwc courtesy of php.net.
 *
 * @param string $str		The text to be reversed.
 * @param string $reverse	true will reverse everything including numbers, false will reverse text only but numbers will be left intact.
 *				example: when true: impresscms 2008 > 8002 smcsserpmi, false: impresscms 2008 > 2008 smcsserpmi
 * @return string
 */
function icms_utf8_strrev($str, $reverse = false)
{
    icms_core_Debug::setDeprecated('icms_core_DataFilter::utf8_strrev', sprintf(_CORE_REMOVE_IN_VERSION, '1.4'));
    return icms_core_DataFilter::utf8_strrev($str, $reverse);
}
예제 #26
0
 /**
  * Retrieve a list of objects as arrays - DON'T USE WITH JOINT KEYS
  *
  * @param object $criteria {@link icms_db_criteria_Element} conditions to be met
  * @param int   $limit      Max number of objects to fetch
  * @param int   $start      Which record to start at
  *
  * @return array
  */
 public function getList($criteria = null, $limit = 0, $start = 0, $debug = false)
 {
     $ret = array();
     if ($criteria == null) {
         $criteria = new icms_db_criteria_Compo();
     }
     if ($criteria->getSort() == '') {
         $criteria->setSort($this->getIdentifierName());
     }
     $sql = 'SELECT ' . (is_array($this->keyName) ? implode(', ', $this->keyName) : $this->keyName);
     if (!empty($this->identifierName)) {
         $sql .= ', ' . $this->getIdentifierName();
     }
     $sql .= ' FROM ' . $this->table . " AS " . $this->_itemname;
     if (isset($criteria) && is_subclass_of($criteria, 'icms_db_criteria_Element')) {
         $sql .= ' ' . $criteria->renderWhere();
         if ($criteria->getSort() != '') {
             $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder();
         }
         $limit = $criteria->getLimit();
         $start = $criteria->getStart();
     }
     if ($debug) {
         icms_core_Debug::message($sql);
     }
     $result = $this->db->query($sql, $limit, $start);
     if (!$result) {
         return $ret;
     }
     while ($myrow = $this->db->fetchArray($result)) {
         //identifiers should be textboxes, so sanitize them like that
         $ret[$myrow[$this->keyName]] = empty($this->identifierName) ? 1 : icms_core_DataFilter::checkVar($myrow[$this->identifierName], 'text', 'output');
     }
     return $ret;
 }
예제 #27
0
if (!isset($_GET['com_order'])) {
    if (is_object(icms::$user)) {
        $com_order = icms::$user->getVar('uorder');
    } else {
        $com_order = $icmsConfig['com_order'];
    }
} else {
    $com_order = (int) $_GET['com_order'];
}
$comment_handler = icms::handler('icms_data_comment');
$comment =& $comment_handler->get($com_id);
$r_name = icms_member_user_Object::getUnameFromId($comment->getVar('com_uid'));
$r_text = _CM_POSTER . ': <strong>' . $r_name . '</strong>&nbsp;&nbsp;' . _CM_POSTED . ': <strong>' . formatTimestamp($comment->getVar('com_created')) . '</strong><br /><br />' . $comment->getVar('com_text');
$com_title = $comment->getVar('com_title', 'E');
if (!preg_match("/^(Re|" . _CM_RE . "):/i", $com_title)) {
    $com_title = _CM_RE . ": " . icms_core_DataFilter::icms_substr($com_title, 0, 56);
}
$com_pid = $com_id;
$com_text = '';
$com_id = 0;
$dosmiley = 1;
$groups = is_object(icms::$user) ? icms::$user->getGroups() : ICMS_GROUP_ANONYMOUS;
$gperm_handler = icms::handler('icms_member_groupperm');
if ($icmsConfig['editor_default'] != 'dhtmltextarea' && $gperm_handler->checkRight('use_wysiwygeditor', 1, $groups, 1, false)) {
    $dohtml = 1;
    $dobr = 0;
} else {
    $dohtml = 0;
    $dobr = 1;
}
$doxcode = 1;
예제 #28
0
 /**
  * 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:
                     $cleanv = !is_string($cleanv) ? (int) $cleanv : strtotime($cleanv);
                     if (!($cleanv > 0)) {
                         $cleanv = strtotime($cleanv);
                     }
                     break;
                 default:
                     break;
             }
         }
         $this->cleanVars[$k] =& $cleanv;
         unset($cleanv);
     }
     if (count($this->_errors) > 0) {
         $this->_errors = array_merge($existing_errors, $this->_errors);
         return false;
     }
     $this->_errors = array_merge($existing_errors, $this->_errors);
     $this->unsetDirty();
     return true;
 }
예제 #29
0
 /**
  * sends a welcome message to the user which account has just been activated
  *
  * return TRUE if success, FALSE if not
  */
 public function sendWelcomeMessage()
 {
     global $icmsConfig, $icmsConfigUser;
     if (!$icmsConfigUser['welcome_msg']) {
         return true;
     }
     $xoopsMailer = new icms_messaging_Handler();
     $xoopsMailer->useMail();
     $xoopsMailer->setBody($icmsConfigUser['welcome_msg_content']);
     $xoopsMailer->assign('UNAME', $this->getVar('uname'));
     $user_email = $this->getVar('email');
     $xoopsMailer->assign('X_UEMAIL', $user_email);
     $xoopsMailer->setToEmails($user_email);
     $xoopsMailer->setFromEmail($icmsConfig['adminmail']);
     $xoopsMailer->setFromName($icmsConfig['sitename']);
     $xoopsMailer->setSubject(sprintf(_US_YOURREGISTRATION, icms_core_DataFilter::stripSlashesGPC($icmsConfig['sitename'])));
     if (!$xoopsMailer->send(true)) {
         $this->setErrors(_US_WELCOMEMSGFAILED);
         return false;
     } else {
         return true;
     }
 }
예제 #30
0
<?php

/**
 * Handles all functions for the invitation form within ImpressCMS
 *
 * @copyright	http://www.impresscms.org/ The ImpressCMS Project
 * @license	LICENSE.txt
 * @package	core
 * @since	1.1
 * @author	modified by UnderDog <*****@*****.**>
 * @version	$Id: inviteform.php 11079 2011-03-17 12:43:06Z m0nty_ $
 */
if (!defined("ICMS_ROOT_PATH")) {
    die("ImpressCMS root path not defined");
}
$invite_form = new icms_form_Theme(_US_USERINVITE, "userinvite", "invite.php", "post", true);
$invite_form->addElement(new icms_form_elements_Text(_US_EMAIL, "email", 25, 60, icms_core_DataFilter::htmlSpecialChars($email)), true);
$invite_form->addElement(new icms_form_elements_Captcha(_SECURITYIMAGE_GETCODE, "scode"), true);
$invite_form->addElement(new icms_form_elements_Hidden("op", "finish"));
$invite_form->addElement(new icms_form_elements_Button("", "submit", _US_SUBMIT, "submit"));