Ejemplo n.º 1
0
function dispatch()
{
	global $xoopsUser;
	
	if($this->isGuest() || !$this->validateToken('CONFIG_EDIT')){
		redirect_header(XOOPS_URL, 2, _NOPERM);
	}
	
	$own_uid = $xoopsUser->getVar('uid');
	
	$config_arr = $this->getConfigArray();
	if(!is_array($config_arr)){
		redirect_header(XSNS_URL_MYPAGE, 2, _MD_XSNS_CONFIG_CHANGE_NG);
	}
	
	$module_config_handler =& XsnsModuleConfigHandler::getInstance();
	$module_config =& $module_config_handler->getOne($own_uid);
	if(!is_object($module_config)){
		$module_config =& $module_config_handler->create();
		$module_config->setVar('uid', $own_uid);
	}
	$module_config->setVar('config_values', $config_arr);
	
	if($module_config_handler->insert($module_config)){
		redirect_header(XSNS_URL_MYPAGE_NEWS.'&uid='.$own_uid, 2, _MD_XSNS_CONFIG_CHANGE_OK);
	}
	redirect_header(XSNS_URL_MYPAGE, 2, _MD_XSNS_CONFIG_CHANGE_NG);
}
Ejemplo n.º 2
0
	function XsnsUser()
	{
		$this->XoopsUser();
		
		$this->ts =& XsnsTextSanitizer::getInstance();
		
		$this->handler = array(
			'community' => XsnsCommunityHandler::getInstance(),
			'member' => XsnsMemberHandler::getInstance(),
			'user' => XsnsUserHandler::getInstance(),
			'friend' => XsnsFriendHandler::getInstance(),
			'confirm' => XsnsConfirmHandler::getInstance(),
			'module_config' => XsnsModuleConfigHandler::getInstance(),
			'intro' => XsnsIntroductionHandler::getInstance(),
		);
	}