예제 #1
0
 /**
  * Constructor
  *
  * @param   string  $name   "name" attribute
  */
 function XoopsFormHiddenToken($name = null, $timeout = 360)
 {
     if (empty($name)) {
         $token =& XoopsMultiTokenHandler::quickCreate(XOOPS_TOKEN_DEFAULT);
         $name = $token->getTokenName();
     } else {
         $token =& XoopsSingleTokenHandler::quickCreate(XOOPS_TOKEN_DEFAULT);
     }
     $this->XoopsFormHidden($name, $token->getTokenValue());
 }
예제 #2
0
function dispatch()
{
	if($this->isGuest()){
		redirect_header(XOOPS_URL, 2, _NOPERM);
	}
	
	require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; 
	$token_handler = new XoopsMultiTokenHandler();
	$token = new XoopsFormToken($token_handler->create('COMMUNITY_EDIT')); 
	// Hidden 
	$token_tag = '<input type="hidden" name="'.$token->_name.'" value="'.$token->_value.'">';
	$this->context->setAttribute('token_tag', $token_tag); 

	$cid = $this->getIntRequest('cid', XSNS_REQUEST_GET);
	if(!isset($cid)){
		redirect_header(XOOPS_URL, 2, _NOPERM);
	}
	
	// コミュニティの取得
	$perm = XSNS_AUTH_XOOPS_ADMIN | XSNS_AUTH_ADMIN;
	$commu_handler =& XsnsCommunityHandler::getInstance();
	$community =& $commu_handler->get($cid);
	if(!is_object($community) || !$community->checkAuthority($perm)){
		redirect_header(XOOPS_URL, 2, _NOPERM);
	}
	
	$commu_data = array(
		'id' => $cid,
		'name' => $community->getVar('name', 'e'),
		'info' => $community->getVar('info', 'e'),
		'del_enabled' => ($community->getTopicCount()==0)? true : false,
		'image' => $community->getImage(XSNS_IMAGE_SIZE_S),
	);
	
	$category_handler =& XsnsCategoryHandler::getInstance();
	$category_selector = $category_handler->getSelectorHtml('category', $community->getVar('c_commu_category_id'));
	
	$this->context->setAttribute('commu', $commu_data);
	$this->context->setAttribute('public_flag', $community->getVar('public_flag'));
	$this->context->setAttribute('category_selector', $category_selector);
}
예제 #3
0
파일: utils.php 프로젝트: nouphet/rata
 function validateToken()
 {
     global $xoopsSecurity;
     if (class_exists('XoopsMultiTokenHandler')) {
         if (!XoopsMultiTokenHandler::quickValidate(XOOPS_TOKEN_DEFAULT)) {
             return false;
         }
     } elseif (is_object($xoopsSecurity)) {
         if (!$xoopsSecurity->validateToken()) {
             return false;
         }
     }
     return true;
 }
예제 #4
0
파일: users.php 프로젝트: koki-h/xoops_utf8
function modifyUser($user)
{
    global $xoopsDB, $xoopsConfig, $xoopsModule;
    xoops_cp_header();
    $member_handler =& xoops_gethandler('member');
    $user =& $member_handler->getUser($user);
    if (is_object($user)) {
        if (!$user->isActive()) {
            xoops_token_confirm(array('fct' => 'users', 'op' => 'reactivate', 'uid' => $user->getVar('uid')), 'admin.php', _AM_NOTACTIVE);
            xoops_cp_footer();
            exit;
        }
        $uid_value = $user->getVar("uid");
        $uname_value = $user->getVar("uname", "E");
        $name_value = $user->getVar("name", "E");
        $email_value = $user->getVar("email", "E");
        $email_cbox_value = $user->getVar("user_viewemail") ? 1 : 0;
        $url_value = $user->getVar("url", "E");
        //      $avatar_value = $user->getVar("user_avatar");
        $temp = $user->getVar("theme");
        //      $theme_value = empty($temp) ? $xoopsConfig['default_theme'] : $temp;
        $timezone_value = $user->getVar("timezone_offset");
        $icq_value = $user->getVar("user_icq", "E");
        $aim_value = $user->getVar("user_aim", "E");
        $yim_value = $user->getVar("user_yim", "E");
        $msnm_value = $user->getVar("user_msnm", "E");
        $location_value = $user->getVar("user_from", "E");
        $occ_value = $user->getVar("user_occ", "E");
        $interest_value = $user->getVar("user_intrest", "E");
        $sig_value = $user->getVar("user_sig", "E");
        $sig_cbox_value = $user->getVar("attachsig") == 1 ? 1 : 0;
        $umode_value = $user->getVar("umode");
        $uorder_value = $user->getVar("uorder");
        // RMV-NOTIFY
        $notify_method_value = $user->getVar("notify_method");
        $notify_mode_value = $user->getVar("notify_mode");
        $bio_value = $user->getVar("bio", "E");
        $rank_value = $user->rank(false);
        $mailok_value = $user->getVar('user_mailok', 'E');
        $op_value = "updateUser";
        $form_title = _AM_UPDATEUSER . ": " . $user->getVar("uname");
        $form_isedit = true;
        $groups = array_values($user->getGroups());
        $token = XoopsMultiTokenHandler::quickCreate('users_synchronize');
        include XOOPS_ROOT_PATH . "/modules/system/admin/users/userform.php";
        echo "<br /><b>" . _AM_USERPOST . "</b><br /><br />\n";
        echo "<table>\n";
        echo "<tr><td>" . _AM_COMMENTS . "</td><td>" . $user->getVar("posts") . "</td></tr>\n";
        echo "</table>\n";
        echo "<br />" . _AM_PTBBTSDIYT . "<br />\n";
        echo "<form action=\"admin.php\" method=\"post\">\n";
        echo $token->getHtml();
        echo "<input type=\"hidden\" name=\"id\" value=\"" . $user->getVar("uid") . "\" />";
        echo "<input type=\"hidden\" name=\"type\" value=\"user\" />\n";
        echo "<input type=\"hidden\" name=\"fct\" value=\"users\" />\n";
        echo "<input type=\"hidden\" name=\"op\" value=\"synchronize\" />\n";
        echo "<input type=\"submit\" value=\"" . _AM_SYNCHRONIZE . "\" />\n";
        echo "</form>\n";
    } else {
        echo "<h4 style='text-align:left;'>";
        echo _AM_USERDONEXIT;
        echo "</h4>";
    }
    xoops_cp_footer();
}
 function renderEditForm($caption, $name, $action, $token = 0)
 {
     include_once XOOPS_ROOT_PATH . '/class/xoopsform/form.php';
     include_once XOOPS_ROOT_PATH . '/class/xoopsform/themeform.php';
     include_once XOOPS_ROOT_PATH . '/class/xoopsform/formhidden.php';
     include_once XOOPS_ROOT_PATH . '/class/xoopsform/formbutton.php';
     if (file_exists(XOOPS_ROOT_PATH . '/class/xoopsform/formtoken.php')) {
         include_once XOOPS_ROOT_PATH . '/class/xoopsform/formtoken.php';
     } else {
         $withtoken = 0;
     }
     $formEdit =& new XoopsThemeForm($caption, $name, $action);
     foreach ($this->_formElements as $key => $formElement) {
         //				if (!$this->isNew()) {
         $formElement->setValue($this->getVar($key, 'e'));
         //				}
         $formEdit->addElement($formElement, $this->vars[$key]['required']);
         //				echo "$key - " .get_class($formElement) ."<br/>";
         unset($formElement);
     }
     if ($this->isNew()) {
         if ($token) {
             $formEdit->addElement(new XoopsFormToken(XoopsMultiTokenHandler::quickCreate($name . '_insert')));
         }
         $formEdit->addElement(new XoopsFormHidden('op', 'insert'));
     } else {
         if ($token) {
             $formEdit->addElement(new XoopsFormToken(XoopsMultiTokenHandler::quickCreate($name . '_save')));
         }
         $formEdit->addElement(new XoopsFormHidden('op', 'save'));
     }
     $formEdit->addElement(new XoopsFormButton('', 'submit', 'OK', 'submit'));
     $str = $formEdit->render();
     unset($formEdit);
     return $str;
 }
예제 #6
0
//  original comment or credit authors.                                      //
//                                                                           //
//  This program is distributed in the hope that it will be useful,          //
//  but WITHOUT ANY WARRANTY; without even the implied warranty of           //
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            //
//  GNU General Public License for more details.                             //
//                                                                           //
//  You should have received a copy of the GNU General Public License        //
//  along with this program; if not, write to the Free Software              //
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
//  ------------------------------------------------------------------------ //
include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
$form = new XoopsThemeForm(_MD_EDITTEMPLATE, 'template_form', 'admin.php');
$form->addElement(new XoopsFormLabel(_MD_FILENAME, $tform['tpl_file']));
$form->addElement(new XoopsFormLabel(_MD_FILEDESC, $tform['tpl_desc']));
$form->addElement(new XoopsFormLabel(_MD_LASTMOD, formatTimestamp($tform['tpl_lastmodified'], 'l')));
$form->addElement(new XoopsFormTextArea(_MD_FILEHTML, 'html', $tform['tpl_source'], 25, 70));
$form->addElement(new XoopsFormHidden('id', $tform['tpl_id']));
$form->addElement(new XoopsFormHidden('op', 'edittpl_go'));
$form->addElement(new XoopsFormToken(XoopsMultiTokenHandler::quickCreate('tplform')));
$form->addElement(new XoopsFormHidden('redirect', 'edittpl'));
$form->addElement(new XoopsFormHidden('fct', 'tplsets'));
$form->addElement(new XoopsFormHidden('moddir', $tform['tpl_module']));
if ($tform['tpl_tplset'] != 'default') {
    $button_tray = new XoopsFormElementTray('');
    $button_tray->addElement(new XoopsFormButton('', 'previewtpl', _PREVIEW, 'submit'));
    $button_tray->addElement(new XoopsFormButton('', 'submittpl', _SUBMIT, 'submit'));
    $form->addElement($button_tray);
} else {
    $form->addElement(new XoopsFormButton('', 'previewtpl', _MD_VIEW, 'submit'));
}
예제 #7
0
    $form->addElement(new XoopsFormFile(_IMAGEFILE, 'image_file', $imgcat->getVar('imgcat_maxsize')), true);
    $form->addElement(new XoopsFormLabel(_IMGMAXSIZE, $imgcat->getVar('imgcat_maxsize')));
    $form->addElement(new XoopsFormLabel(_IMGMAXWIDTH, $imgcat->getVar('imgcat_maxwidth')));
    $form->addElement(new XoopsFormLabel(_IMGMAXHEIGHT, $imgcat->getVar('imgcat_maxheight')));
    $form->addElement(new XoopsFormHidden('imgcat_id', $imgcat_id));
    $form->addElement(new XoopsFormHidden('op', 'doupload'));
    $form->addElement(new XoopsFormToken(XoopsMultiTokenHandler::quickCreate('imagemanager')));
    $form->addElement(new XoopsFormHidden('target', $target));
    $form->addElement(new XoopsFormButton('', 'img_button', _SUBMIT, 'submit'));
    $form->assign($xoopsTpl);
    $xoopsTpl->assign('lang_close', _CLOSE);
    $xoopsTpl->display('db:system_imagemanager2.html');
    exit;
}
if ($op == 'doupload') {
    if (!XoopsMultiTokenHandler::quickValidate('imagemanager')) {
        exit;
    }
    $image_nicename = isset($_POST['image_nicename']) ? $_POST['image_nicename'] : '';
    $xoops_upload_file = isset($_POST['xoops_upload_file']) ? $_POST['xoops_upload_file'] : array();
    $target = isset($_POST['target']) ? $_POST['target'] : '';
    $imgcat_id = isset($_POST['imgcat_id']) ? intval($_POST['imgcat_id']) : 0;
    include_once XOOPS_ROOT_PATH . '/class/uploader.php';
    $imgcat_handler =& xoops_gethandler('imagecategory');
    $imgcat =& $imgcat_handler->get($imgcat_id);
    $error = false;
    if (!is_object($imgcat)) {
        $error = true;
    } else {
        $imgcatperm_handler =& xoops_gethandler('groupperm');
        if (is_object($xoopsUser)) {
예제 #8
0
function validateToken($name, $clearIfValid=true)
{
	$token_handler = new XoopsMultiTokenHandler();
	return $token_handler->autoValidate($name, $clearIfValid);
}
예제 #9
0
 function getTokenHTML()
 {
     $token =& XoopsMultiTokenHandler::quickCreate(XOOPS_TOKEN_DEFAULT);
     return $token->getHtml();
 }
예제 #10
0
파일: index.php 프로젝트: nouphet/rata
require_once dirname(dirname(__FILE__)) . '/include/gtickets.php';
require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
require_once XOOPS_ROOT_PATH . '/class/template.php';
require_once XOOPS_ROOT_PATH . '/class/pagenav.php';
require_once XOOPS_ROOT_PATH . '/class/xoopsform/grouppermform.php';
require_once dirname(dirname(__FILE__)) . '/class/bulletin.php';
require_once dirname(dirname(__FILE__)) . '/class/bulletinTopic.php';
// Sanitizer
$myts =& MyTextSanitizer::getInstance();
// Template
$tpl = new XoopsTpl();
// Determine the operation
$op = isset($_REQUEST['op']) ? $_REQUEST['op'] : 'default';
// Ticket confirmation
if ($op == 'preview' || $op == 'save') {
    if (!XoopsMultiTokenHandler::quickValidate('news_admin_submit')) {
        $op = 'newarticle';
    }
}
// If there are no topics
if ($op == 'form') {
    $BTopic = new BulletinTopic($mydirname);
    if (!$BTopic->topicExists()) {
        redirect_header('index.php?op=topicsmanager', 3, _AM_NO_TOPICS);
        exit;
    }
}
switch ($op) {
    case 'default':
    case 'list':
    default:
예제 #11
0
function assignFormHeader($form_name, $method='post', $target='', $action='', $upload=false, $hidden_vars=NULL, $token_name=NULL)
{
	$page_html = (empty($target))? 
		"" : "<input type=\"hidden\" name=\"".XSNS_PAGE_ARG."\" value=\"".$target."\">\n";
	$action_html = (empty($action))? 
		"" : "<input type=\"hidden\" name=\"".XSNS_ACTION_ARG."\" value=\"".$action."\">\n";
	$upload_html = ($upload)? " enctype=\"multipart/form-data\"" : "";
	
	$form = "<form action=\"index.php\" method=\"".$method."\"".$upload_html.">\n".
			$page_html. $action_html;
	
	if(is_array($hidden_vars)){
		foreach($hidden_vars as $key => $value){
			$form .= "<input type=\"hidden\" name=\"".$key."\" value=\"".$value."\">\n";
		}
	}
	if(!is_null($token_name)){
		$token_handler = new XoopsMultiTokenHandler();
		$token =& $token_handler->create($token_name);
		$form .= $token->getHtml();
	}
	
	$this->tpl->assign($form_name, $form);
}
예제 #12
0
파일: main.php 프로젝트: koki-h/xoops_utf8
         echo "&nbsp;";
     }
     echo "</td><td align='center'>" . formatTimeStamp($foundusers[$j]->getVar("user_regdate"), "s") . "</td><td align='center'>";
     if ($foundusers[$j]->getVar("last_login") != 0) {
         echo formatTimeStamp($foundusers[$j]->getVar("last_login"), "m");
     } else {
         echo "&nbsp;";
     }
     echo "</td><td align='center'>" . $foundusers[$j]->getVar("posts") . "</td>";
     echo "<td align='center'><a href='" . XOOPS_URL . "/modules/system/admin.php?fct=users&amp;uid=" . $foundusers[$j]->getVar("uid") . "&amp;op=modifyUser'>" . _EDIT . "</a></td></tr>\n";
 }
 echo "<tr class='foot'><td><select name='fct'><option value='users'>" . _DELETE . "</option><option value='mailusers'>" . _AM_SENDMAIL . "</option>";
 $group = !empty($_POST['group']) ? intval($_POST['group']) : 0;
 if ($group > 0) {
     // token required for add-user-to-group operation
     $token =& XoopsMultiTokenHandler::quickCreate('groups_User');
     $member_handler =& xoops_gethandler('member');
     $add2group =& $member_handler->getGroup($group);
     echo "<option value='groups' selected='selected'>" . sprintf(_AM_ADD2GROUP, $add2group->getVar('name')) . "</option>";
 }
 echo "</select>&nbsp;";
 if (!empty($token) && is_object($token)) {
     echo $token->getHtml();
 }
 if ($group > 0) {
     echo "<input type='hidden' name='groupid' value='" . $group . "' />";
 }
 echo "</td><td colspan='10'><input type='submit' value='" . _SUBMIT . "' /></td></tr></table></form>\n";
 $totalpages = ceil($total / $limit);
 if ($totalpages > 1) {
     $hiddenform = "<form name='findnext' action='admin.php' method='post'><input type='hidden' name='op' value='findusers' />";
예제 #13
0
function dispatch()
{
	global $xoopsUser;
	
	if($this->isGuest()){
		redirect_header(XOOPS_URL, 2, _NOPERM);
	}
	$own_uid = $xoopsUser->getVar('uid');
	
	$tcid = $this->getIntRequest('tcid', XSNS_REQUEST_GET);
	if(!isset($tcid)){
		redirect_header(XOOPS_URL, 2, _NOPERM);
	}
	
	require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
	$token_handler = new XoopsMultiTokenHandler();
	$token = new XoopsFormToken($token_handler->create('TOPIC_EDIT'));
	// Hidden
	$token_tag = '<input type="hidden" name="'.$token->_name.'" value="'.$token->_value.'">';
	$this->context->setAttribute('token_tag', $token_tag);
	
	$commu_handler =& XsnsCommunityHandler::getInstance();
	$topic_handler =& XsnsTopicHandler::getInstance();
	$comment_handler =& XsnsTopicCommentHandler::getInstance();
	
	// コメントの取得
	$comment =& $comment_handler->get($tcid);
	if(!is_object($comment)){
		redirect_header(XOOPS_URL, 2, _NOPERM);
	}
	$tid = $comment->getVar('c_commu_topic_id');
	
	// トピックの取得
	$topic =& $topic_handler->get($tid);
	if(!is_object($topic)){
		redirect_header(XOOPS_URL, 2, _NOPERM);
	}
	$cid = $topic->getVar('c_commu_id');
	
	// コミュニティの取得
	$community =& $commu_handler->get($cid);
	if(!is_object($community)){
		redirect_header(XOOPS_URL, 2, _NOPERM);
	}
	$commu_auth = $community->getAuthority();
	if($commu_auth < XSNS_AUTH_MEMBER){
		redirect_header(XOOPS_URL, 2, _NOPERM);
	}
	
	$topic_uid = $topic->getVar('uid');
	$comment_uid = $comment->getVar('uid');
	$comment_number = $comment->getNumber();
	
	if($comment_uid > 0
	   && ($own_uid == $topic_uid || $own_uid == $comment_uid || $commu_auth >= XSNS_AUTH_SUB_ADMIN)){
		
		$topic_vars = array(
			'id' => $tid,
			'tcid' => $tcid,
			'name' => $topic->getVar('name', 'e'),
			'lang_page_title' => ($comment_number > 0) ? _MD_XSNS_TITLE_TOPIC_RES_EDIT : _MD_XSNS_TITLE_TOPIC_EDIT,
		);
		
		$comment_vars = array(
			'number' => $comment_number,
			'body' => $comment->getVar('body', 'e'),
			'images' => $comment->getImageList(2, XSNS_IMAGE_SIZE_S),
			'files' => $comment->getFileList(2),
		);
		
		$commu_vars = array('id' => $cid, 'name' => $community->getVar('name'));
		
		$this->context->setAttribute('commu', $commu_vars);
		$this->context->setAttribute('topic', $topic_vars);
		$this->context->setAttribute('comment', $comment_vars);
	}
	else{
		redirect_header(XOOPS_URL, 2, _NOPERM);
	}
}
예제 #14
0
     $areaObject =& $areaHandler->create();
     $areaObject->setFormVars($_POST, '');
     if (!$areaHandler->insert($areaObject, false, true)) {
         include XOOPS_ROOT_PATH . '/header.php';
         $areaObject->setFormVars($_POST, '');
         $areaObject->defineFormElementsForGMap();
         $area_form = $areaObject->renderEditForm("New", "gareaedit", XOOPS_URL . "/modules/mygmap/area.php", 1);
         showAreaForm($area_form, floatval($_POST['mygmap_area_lat']), floatval($_POST['mygmap_area_lng']), intval($_POST['mygmap_area_zoom']), $areaHandler->getErrors());
         include XOOPS_ROOT_PATH . '/footer.php';
     }
     redirect_header(XOOPS_URL . "/modules/mygmap/", 1, '');
     exit;
     break;
 case 'save':
     if (class_exists('XoopsMultiTokenHandler')) {
         if (!XoopsMultiTokenHandler::quickValidate('gareaedit_save')) {
             redirect_header(XOOPS_URL . "/modules/mygmap/", 1, 'Token Error');
         }
     }
     if (isset($_POST['mygmap_area_id'])) {
         $area_id = intval($_POST['mygmap_area_id']);
         if ($areaObject =& $areaHandler->get($area_id)) {
             $areaObject->setFormVars($_POST, '');
             if (!$areaHandler->insert($areaObject, false, true)) {
                 include XOOPS_ROOT_PATH . '/header.php';
                 $areaObject->setFormVars($_POST, '');
                 $areaObject->defineFormElementsForGMap();
                 $area_form = $areaObject->renderEditForm("Edit", "gareaedit", XOOPS_URL . "/modules/mygmap/area.php", 1);
                 showAreaForm($area_form, floatval($_POST['mygmap_area_lat']), floatval($_POST['mygmap_area_lng']), intval($_POST['mygmap_area_zoom']), $areaHandler->getErrors());
                 include XOOPS_ROOT_PATH . '/footer.php';
                 exit;
예제 #15
0
//                                                                           //
//  This program is distributed in the hope that it will be useful,          //
//  but WITHOUT ANY WARRANTY; without even the implied warranty of           //
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            //
//  GNU General Public License for more details.                             //
//                                                                           //
//  You should have received a copy of the GNU General Public License        //
//  along with this program; if not, write to the Free Software              //
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
//  ------------------------------------------------------------------------ //
// Author: Kazumi Ono (AKA onokazu)                                          //
// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
// Project: The XOOPS Project                                                //
// ------------------------------------------------------------------------- //
include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
$smile_form = new XoopsThemeForm($smiles['smile_form'], 'smileform', 'admin.php');
$smile_form->setExtra('enctype="multipart/form-data"');
$smile_form->addElement(new XoopsFormToken(XoopsMultiTokenHandler::quickCreate('smilies_' . $smiles['op'])));
$smile_form->addElement(new XoopsFormText(_AM_SMILECODE, 'smile_code', 26, 25, $smiles['smile_code']), true);
$smile_form->addElement(new XoopsFormText(_AM_SMILEEMOTION, 'smile_desc', 26, 25, $smiles['smile_desc']), true);
$smile_select = new XoopsFormFile('', 'smile_url', 5000000);
$smile_label = new XoopsFormLabel('', '<img src="' . XOOPS_UPLOAD_URL . '/' . $smiles['smile_url'] . '" alt="" />');
$smile_tray = new XoopsFormElementTray(_IMAGEFILE . ':', '&nbsp;');
$smile_tray->addElement($smile_select);
$smile_tray->addElement($smile_label);
$smile_form->addElement($smile_tray);
$smile_form->addElement(new XoopsFormRadioYN(_AM_DISPLAYF, 'smile_display', $smiles['smile_display']));
$smile_form->addElement(new XoopsFormHidden('id', $smiles['id']));
$smile_form->addElement(new XoopsFormHidden('op', $smiles['op']));
$smile_form->addElement(new XoopsFormHidden('fct', 'smilies'));
$smile_form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
예제 #16
0
function xoops_confirm_validate()
{
    return XoopsMultiTokenHandler::quickValidate(XOOPS_TOKEN_DEFAULT);
}
예제 #17
0
function dispatch()
{
	require XSNS_FRAMEWORK_DIR.'/global.php';
	xoops_cp_header();
	
	// 中カテゴリ
	$category_p = $this->context->getAttribute('category_p');
	$category = $this->context->getAttribute('category');
	
	include $mytrustdirpath.'/mymenu.php';
	
	echo "<h4><p style='text-align:center;'>"._AM_XSNS_TITLE_CATEGORY_CONFIG."</p></h4><br>";
	
	echo "<div style='width:500px; margin-left:auto; margin-right:auto;'>";
	echo "<div style='text-align:center; font-size:14px; padding-bottom:15px;'><b>"._AM_XSNS_CATEGORY1._AM_XSNS_CATEGORY_LIST."</b></div>";
	echo "<table border='1' cellpadding='8' style='width:100%; text-align:center;'>";
	
	echo "<colgroup style='width:120px;'></colgroup>".
		 "<colgroup style='width:80px;'></colgroup>".
		 "<colgroup span='2' style='width:50px;'></colgroup>".
		 "<colgroup style='width:70px;'></colgroup>";
	
	echo "<th colspan='5'>"._AM_XSNS_CATEGORY1."</th>";
	
	echo "<tr class='head'>".
			"<td>"._AM_XSNS_CATEGORY_NAME."</td>".
			"<td>"._AM_XSNS_CATEGORY_ORDER."</td>".
			"<td colspan='2'>"._AM_XSNS_CATEGORY_OPERATION."</td>".
			"<td>"._AM_XSNS_CATEGORY2."</td>".
		 "</tr>";
		 
	foreach($category_p as $cat_p){
		$pid = $cat_p['c_commu_category_parent_id'];
		
		echo "<form action='index.php' method='post'>";
		echo "<input type='hidden' name='".XSNS_ACTION_ARG."' value='category_edit_exec'>";
		echo "<input type='hidden' name='mode' value='parent'>";
		echo "<input type='hidden' name='pid' value='".$pid."'>";
		
		echo "<tr class='even'>".
				"<td><input type='text' name='title".$pid."' value='".$cat_p['name']."'></td>".
				"<td><input type='text' name='order".$pid."' size='10' value='".$cat_p['sort_order']."'></td>".
				"<td><input type='submit' name='edit' value='"._AM_XSNS_CATEGORY_EDIT."'></td>".
				"<td><input type='submit' name='delete' value='"._AM_XSNS_CATEGORY_DEL."' onclick=\"javascript:return confirm('"._AM_XSNS_CATEGORY_DEL_CONFIRM."');\"></td>".
				"<td><a href='index.php?".XSNS_ACTION_ARG."=category#".$pid."'>"._AM_XSNS_CATEGORY_LIST."</a></td>".
			 "</tr>";
		
		echo "</form>";
	}
	
	echo "<form action='index.php' method='post'>";
	echo "<input type='hidden' name='".XSNS_ACTION_ARG."' value='category_add_exec'>";
	echo "<input type='hidden' name='mode' value='parent'>";
	
	echo "<tr>".
			"<td><input type='text' name='title'></td>".
			"<td><input type='text' name='order' size='10' value='0'></td>".
			"<td colspan='2'><input type='submit' name='add' value='"._AM_XSNS_CATEGORY_ADD."'></td>".
			"<td></td>".
		 "</tr>";
	echo "</form>";
	
	echo "</table>";
	
	echo "</div>";
	
	echo "<br><br><br>";
	
	echo "<div style='width:400px; margin-left:auto; margin-right:auto;'>";
	
	// 小カテゴリ
	echo "<div style='text-align:center; font-size:14px; padding-bottom:15px;'><b>"._AM_XSNS_CATEGORY2._AM_XSNS_CATEGORY_LIST."</b></div>";
	
	$token_handler = new XoopsMultiTokenHandler();
	$token_add =& $token_handler->create('CATEGORY_ADD');
	$token_edit =& $token_handler->create('CATEGORY_EDIT');
	
	foreach($category_p as $cat_p){
		$pid = $cat_p['c_commu_category_parent_id'];
		
		echo "<table border='1' cellpadding='8' style='width:100%; text-align:center;'>";
		
		echo "<tr>".
				"<th colspan='4'><a name='".$pid."'>".$cat_p['name']."</a></th>".
			 "</tr>";
			 
		echo "<colgroup style='width:120px;'></colgroup>".
			 "<colgroup style='width:80px;'></colgroup>".
			 "<colgroup span='2' style='width:50px;'></colgroup>";
		
		echo "<tr class='head'>".
				"<td>"._AM_XSNS_CATEGORY_NAME."</td>".
				"<td>"._AM_XSNS_CATEGORY_ORDER."</td>".
				"<td colspan='2'>"._AM_XSNS_CATEGORY_OPERATION."</td>".
			 "</tr>";
		
		if(isset($category[$pid])){
			foreach($category[$pid] as $cat){
				$id = $cat['c_commu_category_id'];
				
				echo "<form action='index.php' method='post'>";
				echo "<input type='hidden' name='".XSNS_ACTION_ARG."' value='category_edit_exec'>";
				echo "<input type='hidden' name='id' value='".$id."'>";
				echo $token_edit->getHtml();
				echo "<tr class='even'>".
						"<td><input type='text' name='title".$id."' value='".$cat['name']."'></td>".
						"<td><input type='text' name='order".$id."' size='10' value='".$cat['sort_order']."'></td>".
						"<td><input type='submit' name='edit' value='"._AM_XSNS_CATEGORY_EDIT."'></td>".
						"<td><input type='submit' name='delete' value='"._AM_XSNS_CATEGORY_DEL."'></td>".
					 "</tr>";
				echo "</form>";
			}
		}
		
		echo "<form action='index.php' method='post'>";
		echo "<input type='hidden' name='".XSNS_ACTION_ARG."' value='category_add_exec'>";
		echo "<input type='hidden' name='pid' value='".$pid."'>";
		echo $token_add->getHtml();
		echo "<tr>".
				"<td><input type='text' name='title'></td>".
				"<td><input type='text' name='order' size='10' value='0'></td>".
				"<td colspan='2'><input type='submit' name='add' value='"._AM_XSNS_CATEGORY_ADD."'></td>".
			 "</tr>";
		echo "</table>";
		echo "</form>";
		
		echo "<br><br>";
	}
	
	echo "</div>";
	
	xoops_cp_footer();
}
예제 #18
0
     } else {
         $pm_handler =& xoops_gethandler('privmessage');
         $pm =& $pm_handler->create();
         $pm->setVar("subject", $_POST['subject']);
         $pm->setVar("msg_text", $_POST['message']);
         $pm->setVar("to_userid", $_POST['to_userid']);
         $pm->setVar("from_userid", $xoopsUser->getVar("uid"));
         if (!$pm_handler->insert($pm)) {
             echo $pm->getHtmlErrors();
             echo "<br /><a href='javascript:history.go(-1)'>" . _PM_GOBACK . "</a>";
         } else {
             echo "<br /><br /><div style='text-align:center;'><h4>" . _PM_MESSAGEPOSTED . "</h4><br /><a href=\"javascript:window.opener.location='" . XOOPS_URL . "/viewpmsg.php';window.close();\">" . _PM_CLICKHERE . "</a><br /><br /><a href=\"javascript:window.close();\">" . _PM_ORCLOSEWINDOW . "</a></div>";
         }
     }
 } elseif ($reply == 1 || $send == 1 || $send2 == 1) {
     $token =& XoopsMultiTokenHandler::quickCreate('pm');
     include_once XOOPS_ROOT_PATH . "/include/xoopscodes.php";
     if ($reply == 1) {
         $pm_handler =& xoops_gethandler('privmessage');
         $pm =& $pm_handler->get($msg_id);
         if ($pm->getVar("to_userid") == $xoopsUser->getVar('uid')) {
             $pm_uname = XoopsUser::getUnameFromId($pm->getVar("from_userid"));
             $message = "[quote]\n";
             $message .= sprintf(_PM_USERWROTE, $pm_uname);
             $message .= "\n" . $pm->getVar("msg_text", "E") . "\n[/quote]";
         } else {
             unset($pm);
             $reply = $send2 = 0;
         }
     }
     echo "<form action='pmlite.php' method='post' name='coolsus'>\n";
예제 #19
0
파일: main.php 프로젝트: koki-h/xoops_utf8
                 if (!empty($_POST['groups'])) {
                     foreach ($_POST['groups'] as $groupid) {
                         $member_handler->addUserToGroup(intval($groupid), $newuser->getVar('uid'));
                     }
                 }
                 redirect_header("admin.php?fct=users", 1, _AM_DBUPDATED);
                 exit;
             }
         }
     }
     xoops_cp_header();
     xoops_error($adduser_errormsg);
     xoops_cp_footer();
     break;
 case "synchronize":
     if (!XoopsMultiTokenHandler::quickValidate('users_synchronize')) {
         system_users_error("Ticket Error");
     }
     synchronize($_POST['id'], $_POST['type']);
     break;
 case "reactivate":
     if (!xoops_confirm_validate()) {
         system_users_error("Ticket Error");
     }
     $uid = !empty($_POST['uid']) ? intval($_POST['uid']) : 0;
     if ($uid > 0) {
         $result = $xoopsDB->query("UPDATE " . $xoopsDB->prefix("users") . " SET level=1 WHERE uid=" . $uid);
     }
     redirect_header("admin.php?fct=users&amp;op=modifyUser&amp;uid=" . $uid, 1, _AM_DBUPDATED);
     break;
 case "mod_users":
예제 #20
0
파일: main.php 프로젝트: koki-h/xoops_utf8
             unset($avatar_weight[$i]);
             unset($avatar_display[$i]);
         }
         if (count($error) > 0) {
             xoops_cp_header();
             foreach ($error as $err) {
                 echo $err . '<br />';
             }
             xoops_cp_footer();
             exit;
         }
     }
     redirect_header('admin.php?fct=avatars', 2, _MD_AM_DBUPDATED);
 }
 if ($op == 'addfile') {
     if (!XoopsMultiTokenHandler::quickValidate('avatars_addfile')) {
         xoops_cp_header();
         xoops_error('Ticket Error');
         xoops_cp_footer();
         exit;
     }
     include_once XOOPS_ROOT_PATH . '/class/uploader.php';
     $uploader = new XoopsMediaUploader(XOOPS_UPLOAD_PATH, array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/x-png', 'image/png'), 500000);
     $uploader->setAllowedExtensions(array('gif', 'jpeg', 'jpg', 'png'));
     $uploader->setPrefix('savt');
     $err = array();
     $ucount = count($_POST['xoops_upload_file']);
     for ($i = 0; $i < $ucount; $i++) {
         if ($uploader->fetchMedia($_POST['xoops_upload_file'][$i])) {
             if (!$uploader->upload()) {
                 $err[] = $uploader->getErrors();
예제 #21
0
function dispatch()
{
	require XSNS_FRAMEWORK_DIR.'/global.php';
	xoops_cp_header();
	
	include $mytrustdirpath.'/mymenu.php';
	
	$file_list = $this->context->getAttribute('file_list');
	$pager = $this->context->getAttribute('pager');
	
	echo "<h4><p style='text-align:center;'>"._AM_XSNS_TITLE_FILE_CONFIG."</p></h4>";
	
	if(count($file_list) > 0){
		
		$header_list = array(
			_AM_XSNS_FILE_NAME,
			_AM_XSNS_FILE_SIZE,
			_AM_XSNS_POST_DATE,
			_AM_XSNS_FILE_AUTHOR,
			_AM_XSNS_FILE_REF,
			_AM_XSNS_FILE_DELETE,
		);
		$header_count = count($header_list);
		
		echo "<div style='width:90%; margin-left:auto; margin-right:auto;'>";
		echo "<table class='outer' style='width:100%; text-align:center;'>";
		echo "<form action='index.php' method='post'>".
			 "<input type='hidden' name='".XSNS_ACTION_ARG."' value='file_del_exec'>";
		
		$pager_html = $this->getPageSelector($pager, $header_count);
		
		echo "<tr>";
		foreach($header_list as $header){
			echo "<th>".$header."</th>";
		}
		echo "</tr>";
		
		echo "<colgroup style='text-align:left;'></colgroup>".
			 "<colgroup style='text-align:right; width:150px;'></colgroup>".
			 "<colgroup style='width:120px;'></colgroup>".
			 "<colgroup style='text-align:left; width:150px;'></colgroup>".
			 "<colgroup style='width:40px;'></colgroup>".
			 "<colgroup style='width:40px;'></colgroup>";
		
		foreach($file_list as $file){
			echo "<tr class='even' style='text-align:center;'>".
					"<td><a href='".$file['url']."'>".$file['filename']."</a></td>".
					"<td>".$file['size']." bytes</td>".
					"<td>".$file['time']."</td>".
					"<td>".$file['author']."</td>".
					"<td>".$file['ref_link']."</td>".
					"<td><input type='checkbox' name='delete[]' value='".$file['id']."'></td>".
				 "</tr>";
		}
		echo $pager_html;
		
		$token_handler = new XoopsMultiTokenHandler();
		$token =& $token_handler->create('FILE_DELETE');
		
		echo "<tr class='foot'>".
			 "<td colspan='".$header_count."' style='text-align:center; padding:15px 0 15px 0;'>".
			 "<input type='submit' value='"._SUBMIT."'>".
			 $token->getHtml().
			 "</td>".
			 "</tr>";
		
		echo "</form>";
		echo "</table>";
		echo "</div>";
	}
	xoops_cp_footer();
}
예제 #22
0
파일: smilies.php 프로젝트: hiro1173/legacy
function SmilesAdmin()
{
    $db =& Database::getInstance();
    $url_smiles = XOOPS_UPLOAD_URL;
    $myts =& MyTextSanitizer::getInstance();
    xoops_cp_header();
    echo "<h4 style='text-align:left;'>" . _AM_SMILESCONTROL . "</h4>";
    if ($getsmiles = $db->query("SELECT * FROM " . $db->prefix("smiles"))) {
        if (($numsmiles = $db->getRowsNum($getsmiles)) == "0") {
            //EMPTY
        } else {
            $token =& XoopsMultiTokenHandler::quickCreate('smilies_SmilesUpdate');
            echo '<form action="admin.php" method="post"><table width="100%" class="outer" cellpadding="4" cellspacing="1">';
            echo $token->getHtml();
            echo "<tr align='center'><th align='left'>" . _AM_CODE . "</th>";
            echo "<th>" . _AM_SMILIE . "</th>";
            echo "<th>" . _AM_SMILEEMOTION . "</th>";
            echo "<th>" . _AM_DISPLAYF . "</th>";
            echo "<th>" . _AM_ACTION . "</th>";
            echo "</tr>\n";
            $i = 0;
            while ($smiles = $db->fetchArray($getsmiles)) {
                if ($i % 2 == 0) {
                    $class = 'even';
                } else {
                    $class = 'odd';
                }
                $smiles['code'] = $myts->makeTboxData4Show($smiles['code']);
                $smiles['smile_url'] = $myts->makeTboxData4Edit($smiles['smile_url']);
                $smiles['smile_emotion'] = $myts->makeTboxData4Edit($smiles['emotion']);
                echo "<tr align='center' class='{$class}'>";
                echo "<td align='left'>" . $smiles['code'] . "</td>";
                echo "<td><img src='" . $url_smiles . "/" . $smiles['smile_url'] . "' alt='' /></td>";
                echo '<td>' . $smiles['smile_emotion'] . '</td>';
                echo '<td><input type="hidden" name="smile_id[' . $i . ']" value="' . $smiles['id'] . '" /><input type="hidden" name="old_display[' . $i . ']" value="' . $smiles['display'] . '" /><input type="checkbox" value="1" name="smile_display[' . $i . ']"';
                if ($smiles['display'] == 1) {
                    echo ' checked="checked"';
                }
                echo " /></td><td><a href='admin.php?fct=smilies&amp;op=SmilesEdit&amp;id=" . $smiles['id'] . "'>" . _AM_EDIT . "</a>&nbsp;";
                echo "<a href='admin.php?fct=smilies&amp;op=SmilesDel&amp;id=" . $smiles['id'] . "'>" . _AM_DEL . "</a></td>";
                echo "</tr>\n";
                $i++;
            }
            echo '<tr><td class="foot" colspan="5" align="center"><input type="hidden" name="op" value="SmilesUpdate" /><input type="hidden" name="fct" value="smilies" />';
            //echo xoops_token_gethtml();
            echo '<input type="submit" value="' . _SUBMIT . '" /></tr></table></form>';
        }
    } else {
        echo _AM_CNRFTSD;
    }
    $smiles['smile_code'] = '';
    $smiles['smile_url'] = 'blank.gif';
    $smiles['smile_desc'] = '';
    $smiles['smile_display'] = 1;
    $smiles['smile_form'] = _AM_ADDSMILE;
    $smiles['op'] = 'SmilesAdd';
    $smiles['id'] = '';
    include XOOPS_ROOT_PATH . '/modules/system/admin/smilies/smileform.php';
    $smile_form->display();
    xoops_cp_footer();
}
예제 #23
0
//  but WITHOUT ANY WARRANTY; without even the implied warranty of           //
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            //
//  GNU General Public License for more details.                             //
//                                                                           //
//  You should have received a copy of the GNU General Public License        //
//  along with this program; if not, write to the Free Software              //
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
//  ------------------------------------------------------------------------ //
// Author: Kazumi Ono (AKA onokazu)                                          //
// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
// Project: The XOOPS Project                                                //
// ------------------------------------------------------------------------- //
include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
$rank_form = new XoopsThemeForm($rank['form_title'], 'rankform', 'admin.php');
$rank_form->setExtra('enctype="multipart/form-data"');
$rank_form->addElement(new XoopsFormToken(XoopsMultiTokenHandler::quickCreate('userrank_' . $rank['op'])));
$rank_form->addElement(new XoopsFormText(_AM_RANKTITLE, 'rank_title', 50, 50, $rank['rank_title']), true);
$rank_form->addElement(new XoopsFormText(_AM_MINPOST, 'rank_min', 10, 10, $rank['rank_min']));
$rank_form->addElement(new XoopsFormText(_AM_MAXPOST, 'rank_max', 10, 10, $rank['rank_max']));
$rank_tray = new XoopsFormElementTray(_AM_IMAGE, '&nbsp;');
$rank_select = new XoopsFormFile('', 'rank_image', 5000000);
$rank_tray->addElement($rank_select);
if (trim($rank['rank_image']) != '' && file_exists(XOOPS_UPLOAD_PATH . '/' . $rank['rank_image'])) {
    $rank_label = new XoopsFormLabel('', '<img src="' . XOOPS_UPLOAD_URL . '/' . $rank['rank_image'] . '" alt="" />');
    $rank_tray->addElement($rank_label);
}
$rank_form->addElement($rank_tray);
$tray = new XoopsFormElementTray(_AM_SPECIAL, '<br />');
$tray->addElement(new XoopsFormRadioYN('', 'rank_special', $rank['rank_special']));
$tray->addElement(new XoopsFormLabel('', _AM_SPECIALCAN));
$rank_form->addElement($tray);
예제 #24
0
파일: token.php 프로젝트: hiro1173/legacy
 /**
  * static method.
  * This method was created for quick protection of default modules.
  * this method will be deleted in the near future.
  * @deprecated
  * @return bool
  */
 function quickValidate($name, $clearIfValid = true)
 {
     $handler = new XoopsMultiTokenHandler();
     return $handler->autoValidate($name, $clearIfValid);
 }
예제 #25
0
파일: main.php 프로젝트: koki-h/xoops_utf8
     preview_window = openWithSelfMain("", "xoops_system_template_preview", 680, 450, true);
     ';
         $lines = preg_split("/(\r\n|\r|\n)( *)/", $xoopsTpl->fetch('file:' . XOOPS_CACHE_PATH . '/' . $dummyfile));
         $xoopsTpl->clear_compiled_tpl('file:' . XOOPS_CACHE_PATH . '/' . $dummyfile);
         unlink(XOOPS_CACHE_PATH . '/' . $dummyfile);
         foreach ($lines as $line) {
             echo 'preview_window.document.writeln("' . str_replace('"', '\\"', $line) . '");';
         }
         echo '
     preview_window.document.close();
     //-->
     </script>';
     }
     break;
 case 'update':
     if (!XoopsMultiTokenHandler::quickValidate('tplsets_update')) {
         redirect_header('admin.php?fct=tplsets', 3, 'Ticket Error');
     }
     $tplset = isset($_POST['tplset']) ? $myts->stripslashesGPC(trim($_POST['tplset'])) : '';
     $moddir = $_POST['moddir'];
     include_once XOOPS_ROOT_PATH . '/class/uploader.php';
     $uploader = new XoopsMediaUploader(XOOPS_UPLOAD_PATH, array('text/html', 'application/x-cdf'), 200000);
     $uploader->setAllowedExtensions(array('html', 'htm'));
     $uploader->setPrefix('tmp');
     $msg = array();
     foreach ($_POST['xoops_upload_file'] as $upload_file) {
         // '.' is converted to '_' when upload
         $upload_file2 = str_replace('.', '_', $upload_file);
         if ($uploader->fetchMedia($upload_file2)) {
             if (!$uploader->upload()) {
                 $msg[] = $uploader->getErrors();
예제 #26
0
파일: main.php 프로젝트: hiro1173/legacy
     if ($rank_special == 1) {
         $sql = "INSERT INTO " . $db->prefix("ranks") . " (rank_id, rank_title, rank_min, rank_max, rank_special, rank_image) VALUES ({$newid}, " . $db->quoteString($rank_title) . ", -1, -1, 1, " . $db->quoteString($rank_image) . ")";
     } else {
         $sql = "INSERT INTO " . $db->prefix("ranks") . " (rank_id, rank_title, rank_min, rank_max, rank_special, rank_image) VALUES ({$newid}, " . $db->quoteString($rank_title) . ", " . intval($_POST['rank_min']) . " , " . intval($_POST['rank_max']) . " , 0, " . $db->quoteString($rank_image) . ")";
     }
     if (!$db->query($sql)) {
         xoops_cp_header();
         xoops_error('Failed storing rank data into the database');
         xoops_cp_footer();
     } else {
         redirect_header("admin.php?fct=userrank&amp;op=RankForumAdmin", 1, _AM_DBUPDATED);
     }
     break;
 case "RankForumSave":
     $rank_id = isset($_POST['rank_id']) ? intval($_POST['rank_id']) : 0;
     if ($rank_id <= 0 || !XoopsMultiTokenHandler::quickValidate('userrank_RankForumSave')) {
         redirect_header("admin.php?fct=userrank");
     }
     $db =& Database::getInstance();
     $myts =& MyTextSanitizer::getInstance();
     $rank_special = isset($_POST['rank_special']) && intval($_POST['rank_special']) ? 1 : 0;
     $rank_title = $myts->stripSlashesGPC($_POST['rank_title']);
     $delete_old_image = false;
     include_once XOOPS_ROOT_PATH . '/class/uploader.php';
     $uploader = new XoopsMediaUploader(XOOPS_UPLOAD_PATH, array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/x-png'), 100000, 120, 120);
     $uploader->setAllowedExtensions(array('gif', 'jpeg', 'jpg', 'png'));
     $uploader->setPrefix('rank');
     if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {
         if ($uploader->upload()) {
             $rank_image = $uploader->getSavedFileName();
             $delete_old_image = true;
예제 #27
0
// Groups administration addition XOOPS 2.0.9: Mith
global $xoopsUser;
$gperm_handler =& xoops_gethandler('groupperm');
//If user has admin rights on groups
if ($gperm_handler->checkRight("system_admin", XOOPS_SYSTEM_GROUP, $xoopsUser->getGroups(), 1)) {
    //add group selection
    $group_select = new XoopsFormSelectGroup(_US_GROUPS, 'groups', false, $groups, 5, true);
} else {
    //add empty variable
    $group_select = new XoopsFormHidden('groups[]', XOOPS_GROUP_USERS);
}
$fct_hidden = new XoopsFormHidden("fct", "users");
$op_hidden = new XoopsFormHidden("op", $op_value);
$submit_button = new XoopsFormButton("", "submit", _SUBMIT, "submit");
$form = new XoopsThemeForm($form_title, "userinfo", "admin.php");
$form->addElement(new XoopsFormToken(XoopsMultiTokenHandler::quickCreate('users_' . $op_value)));
$form->addElement($uname_text, true);
$form->addElement($name_text);
$form->addElement($email_tray, true);
$form->addElement($url_text);
//  $form->addElement($avatar_tray);
//  $form->addElement($theme_select);
$form->addElement($timezone_select);
$form->addElement($icq_text);
$form->addElement($aim_text);
$form->addElement($yim_text);
$form->addElement($msnm_text);
$form->addElement($location_text);
$form->addElement($occupation_text);
$form->addElement($interest_text);
$form->addElement($sig_tray);
예제 #28
0
function dispatch()
{
	if($this->isGuest()){
		redirect_header(XOOPS_URL, 2, _NOPERM);
	}
	
	$tid = $this->getIntRequest('tid');
	if(!isset($tid)){
		redirect_header(XOOPS_URL, 2, _NOPERM);
	}
	
	require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
	$token_handler = new XoopsMultiTokenHandler();
	$token = new XoopsFormToken($token_handler->create('TOPIC_COMMENT_ADD'));
	// Hidden
	$token_tag = '<input type="hidden" name="'.$token->_name.'" value="'.$token->_value.'">';
	$this->context->setAttribute('token_tag', $token_tag);

	
	$commu_handler =& XsnsCommunityHandler::getInstance();
	$topic_handler =& XsnsTopicHandler::getInstance();
	
	// トピックの取得
	$topic =& $topic_handler->get($tid);
	if(!is_object($topic) || $topic->getCommentCount() >= 1001){
		redirect_header(XOOPS_URL, 2, _NOPERM);
	}
	
	// コミュニティの取得
	$cid = $topic->getVar('c_commu_id');
	$community =& $commu_handler->get($cid);
	if(!is_object($community)){
		redirect_header(XOOPS_URL, 2, _NOPERM);
	}
	$commu_auth = $community->getAuthority();
	if($commu_auth < XSNS_AUTH_NON_MEMBER
	   || ($commu_auth < XSNS_AUTH_MEMBER && $community->getVar('public_flag')==3) ){
		redirect_header(XOOPS_URL, 2, _NOPERM);
	}
	
	$errors = array();
	
	$body = $this->getTextRequest('body');
	if(empty($body)){
		$errors[] = _MD_XSNS_TOPIC_RES_BODY_NG;
	}
	
	if(count($errors) > 0){
		redirect_header(XSNS_URL_TOPIC.'&tid='.$tid, 2, _MD_XSNS_TOPIC_RES_BODY_NG);
	}
	
	$comment_handler =& XsnsTopicCommentHandler::getInstance();
	$new_comment =& $comment_handler->create();
	$new_comment->setVar('body', $body);
	
	$commu_vars = array('id' => $cid, 'name' => $community->getVar('name'));
	
	$sess_handler =& XsnsSessionHandler::getInstance();
	$sess_handler->setVar('comment_body', $body);
	
	$image_handler =& XsnsImageHandler::getInstance();
	$file_handler =& XsnsFileHandler::getInstance();
	
	$topic_vars = array(
		'id' => $tid,
		'name' => $topic->getVar('name'),
		'body' => preg_replace('/\[res\]([1-9]\\d*)\[\/res\]/', '>>\1', $new_comment->getVar('body', 'p')),
		'images' => $image_handler->uploadImageTemp('images'),
		'files' => $file_handler->uploadFileTemp('files'),
	);
	
	$this->context->setAttribute('topic', $topic_vars);
	$this->context->setAttribute('commu', $commu_vars);
}
예제 #29
0
파일: main.php 프로젝트: koki-h/xoops_utf8
     }
     $db =& Database::getInstance();
     $sql = sprintf("DELETE FROM %s WHERE bid = %u", $db->prefix("banner"), $bid);
     $db->query($sql);
     redirect_header("admin.php?fct=banners&amp;op=BannersAdmin#top", 1, _AM_DBUPDATED);
     break;
 case "BannerEdit":
     $bid = isset($_GET['bid']) ? intval($_GET['bid']) : 0;
     if ($bid > 0) {
         BannerEdit($bid);
     }
     break;
 case "BannerChange":
     $bid = isset($_POST['bid']) ? intval($_POST['bid']) : 0;
     $cid = isset($_POST['cid']) ? intval($_POST['cid']) : 0;
     if ($cid <= 0 || $bid <= 0 || !XoopsMultiTokenHandler::quickValidate('banners_BannerChange')) {
         redirect_header("admin.php?fct=banners&amp;op=BannersAdmin#top");
     }
     $imageurl = isset($_POST['imageurl']) ? trim($_POST['imageurl']) : '';
     $clickurl = isset($_POST['clickurl']) ? trim($_POST['clickurl']) : '';
     $imptotal = isset($_POST['imptotal']) ? intval($_POST['imptotal']) : 0;
     $impadded = isset($_POST['impadded']) ? intval($_POST['impadded']) : 0;
     $htmlbanner = isset($_POST['htmlbanner']) ? intval($_POST['htmlbanner']) : 0;
     $htmlcode = isset($_POST['htmlcode']) ? trim($_POST['htmlcode']) : '';
     $db =& Database::getInstance();
     $myts =& MyTextSanitizer::getInstance();
     $sql = sprintf("UPDATE %s SET cid = %d, imptotal = %d, imageurl = %s, clickurl = %s, htmlbanner = %d, htmlcode = %s WHERE bid = %d", $db->prefix("banner"), $cid, $imptotal + $impadded, $db->quoteString($myts->stripSlashesGPC($imageurl)), $db->quoteString($myts->stripSlashesGPC($clickurl)), $htmlbanner, $db->quoteString($myts->stripSlashesGPC($htmlcode)), $bid);
     $db->query($sql);
     redirect_header("admin.php?fct=banners&amp;op=BannersAdmin#top", 1, _AM_DBUPDATED);
     break;
 case "BannerClientDelete":
예제 #30
0
파일: main.php 프로젝트: koki-h/xoops_utf8
         }
         $hidden = new XoopsFormHidden('conf_ids[]', $config[$i]->getVar('conf_id'));
         $form->addElement($ele);
         $form->addElement($hidden);
         unset($ele);
         unset($hidden);
     }
     $form->addElement(new XoopsFormHidden('op', 'save'));
     $form->addElement(new XoopsFormButton('', 'button', _GO, 'submit'));
     xoops_cp_header();
     $form->display();
     xoops_cp_footer();
     exit;
 }
 if ($op == 'save') {
     if (!XoopsMultiTokenHandler::quickValidate('preferences')) {
         xoops_cp_header();
         xoops_error("Token Error");
         xoops_cp_footer();
     }
     require_once XOOPS_ROOT_PATH . '/class/template.php';
     $xoopsTpl = new XoopsTpl();
     $xoopsTpl->clear_all_cache();
     // regenerate admin menu file
     xoops_module_write_admin_menu(xoops_module_get_admin_menu());
     $count = count($_POST['conf_ids']);
     $conf_ids = $_POST['conf_ids'];
     $tpl_updated = false;
     $theme_updated = false;
     $startmod_updated = false;
     $lang_updated = false;