From: <tr...@us...> - 2011-10-25 20:28:18
|
Revision: 7961 http://xoops.svn.sourceforge.net/xoops/?rev=7961&view=rev Author: trabis Date: 2011-10-25 20:28:11 +0000 (Tue, 25 Oct 2011) Log Message: ----------- More refactoring. removing xmlrpc.php (this file is related with news module) Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoops.php XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/block.php XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/module.php XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/notification.php XoopsCore/branches/2.6.x/2.6.0/htdocs/register.php XoopsCore/branches/2.6.x/2.6.0/htdocs/search.php XoopsCore/branches/2.6.x/2.6.0/htdocs/user.php XoopsCore/branches/2.6.x/2.6.0/htdocs/userinfo.php XoopsCore/branches/2.6.x/2.6.0/htdocs/viewpmsg.php Removed Paths: ------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/xmlrpc.php Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoops.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoops.php 2011-10-25 20:06:30 UTC (rev 7960) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoops.php 2011-10-25 20:28:11 UTC (rev 7961) @@ -383,7 +383,7 @@ $xoops->logger->stopTime(); $xoops->preload->triggerEvent('core.footer.end'); - return true; + exit(); } /** Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/block.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/block.php 2011-10-25 20:06:30 UTC (rev 7960) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/block.php 2011-10-25 20:28:11 UTC (rev 7961) @@ -425,6 +425,7 @@ $op = 'save'; } else { // Search modules + /* @var $blocklinkmodule_handler SystemBlocklinkmoduleHandler */ $blocklinkmodule_handler = xoops_getModuleHandler('blocklinkmodule', 'system'); $criteria = new CriteriaCompo(new Criteria('block_id', $this->getVar('bid'))); $blocklinkmodule = $blocklinkmodule_handler->getObjects($criteria); @@ -731,14 +732,12 @@ } /** - * XoopsBlock::getAllBlocks() - * * @param string $rettype - * @param mixed $side - * @param mixed $visible + * @param null $side + * @param null $visible * @param string $orderby - * @param integer $isactive - * @return + * @param int $isactive + * @return array */ public function getAllBlocks($rettype = "object", $side = null, $visible = null, $orderby = "side,weight,bid", $isactive = 1) { @@ -791,11 +790,9 @@ } /** - * XoopsBlock::getByModule() - * - * @param mixed $moduleid - * @param mixed $asobject - * @return + * @param int $moduleid + * @param bool $asobject + * @return array */ public function getByModule($moduleid, $asobject = true) { @@ -827,7 +824,7 @@ * @param mixed $visible * @param string $orderby * @param integer $isactive - * @return + * @return array */ public function getAllByGroupModule($groupid, $module_id = 0, $toponlyblock = false, $visible = null, $orderby = 'b.weight, m.block_id', $isactive = 1) { @@ -894,7 +891,7 @@ * @param mixed $visible * @param string $orderby * @param integer $isactive - * @return + * @return array */ public function getNonGroupedBlocks($module_id = 0, $toponlyblock = false, $visible = null, $orderby = 'b.weight, m.block_id', $isactive = 1) { @@ -952,10 +949,10 @@ /** * XoopsBlock::countSimilarBlocks() * - * @param mixed $moduleId - * @param mixed $funcNum + * @param int $moduleId + * @param string $funcNum * @param mixed $showFunc - * @return + * @return int */ public function countSimilarBlocks($moduleId, $funcNum, $showFunc = null) { @@ -1017,7 +1014,10 @@ /************ system ***************/ - + /** + * @param int $groupid + * @return array + */ function getBlockByPerm($groupid) { $ret = array(); @@ -1040,6 +1040,7 @@ } return $blockids; } + return $ret; } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/module.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/module.php 2011-10-25 20:06:30 UTC (rev 7960) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/module.php 2011-10-25 20:28:11 UTC (rev 7961) @@ -404,6 +404,7 @@ */ public function getByDirName($dirname) { + /* @var $modhandler XoopsModuleHandler */ $modhandler = xoops_gethandler('module'); $inst = $modhandler->getByDirname($dirname); return $inst; @@ -497,6 +498,7 @@ } else { return false; } + /* @var $module XoopsModule */ $_cachedModule_dirname[$dirname] = $module; $_cachedModule_mid[$module->getVar('mid')] = $module; return $module; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/notification.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/notification.php 2011-10-25 20:06:30 UTC (rev 7960) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/kernel/notification.php 2011-10-25 20:28:11 UTC (rev 7961) @@ -280,7 +280,7 @@ * @param int $item_id * @param string $event * @param int $user_id - * @return array|bool + * @return XoopsNotification|bool */ public function getNotification($module_id, $category, $item_id, $event, $user_id) { Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/register.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/register.php 2011-10-25 20:06:30 UTC (rev 7960) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/register.php 2011-10-25 20:28:11 UTC (rev 7961) @@ -1,17 +1,15 @@ <?php -/* - You may not change or alter any portion of this comment or credits - of supporting developers from this source code or any supporting source code - which is considered copyrighted (c) material of the 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. -*/ - /** * XOOPS Register * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the 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 enclosed file license.txt for licensing information. * If you did not receive this file, get it at http://www.fsf.org/copyleft/gpl.html * Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/search.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/search.php 2011-10-25 20:06:30 UTC (rev 7960) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/search.php 2011-10-25 20:28:11 UTC (rev 7961) @@ -1,17 +1,14 @@ <?php -/* - You may not change or alter any portion of this comment or credits - of supporting developers from this source code or any supporting source code - which is considered copyrighted (c) material of the 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. -*/ - /** * XOOPS global search * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the 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 enclosed file license.txt for licensing information. * If you did not receive this file, get it at http://www.fsf.org/copyleft/gpl.html * @@ -24,10 +21,14 @@ * @version $Id$ * @todo Modularize; Both search algorithms and interface will be redesigned */ + include dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mainfile.php'; xoops_loadLanguage('search'); +$xoops = Xoops::getInstance(); + +/* @var $config_handler XoopsConfigHandler */ $config_handler = xoops_gethandler('config'); $xoopsConfigSearch = $config_handler->getConfigsByCat(XOOPS_CONF_SEARCH); @@ -38,36 +39,48 @@ $action = "search"; if (!empty($_GET['action'])) { $action = trim(strip_tags($_GET['action'])); -} else if (!empty($_POST['action'])) { - $action = trim(strip_tags($_POST['action'])); +} else { + if (!empty($_POST['action'])) { + $action = trim(strip_tags($_POST['action'])); + } } $query = ""; if (!empty($_GET['query'])) { $query = trim(strip_tags($_GET['query'])); -} else if (!empty($_POST['query'])) { - $query = trim(strip_tags($_POST['query'])); +} else { + if (!empty($_POST['query'])) { + $query = trim(strip_tags($_POST['query'])); + } } $andor = "AND"; if (!empty($_GET['andor'])) { $andor = trim(strip_tags($_GET['andor'])); -} else if (!empty($_POST['andor'])) { - $andor = trim(strip_tags($_POST['andor'])); +} else { + if (!empty($_POST['andor'])) { + $andor = trim(strip_tags($_POST['andor'])); + } } $mid = $uid = $start = 0; if (!empty($_GET['mid'])) { $mid = intval($_GET['mid']); -} else if (!empty($_POST['mid'])) { - $mid = intval($_POST['mid']); +} else { + if (!empty($_POST['mid'])) { + $mid = intval($_POST['mid']); + } } if (!empty($_GET['uid'])) { $uid = intval($_GET['uid']); -} else if (!empty($_POST['uid'])) { - $uid = intval($_POST['uid']); +} else { + if (!empty($_POST['uid'])) { + $uid = intval($_POST['uid']); + } } if (!empty($_GET['start'])) { $start = intval($_GET['start']); -} else if (!empty($_POST['start'])) { - $start = intval($_POST['start']); +} else { + if (!empty($_POST['start'])) { + $start = intval($_POST['start']); + } } $queries = array(); @@ -77,26 +90,31 @@ redirect_header("search.php", 1, _SR_PLZENTER); exit(); } -} else if ($action == "showall") { - if ($query == "" || empty($mid)) { - redirect_header("search.php", 1, _SR_PLZENTER); - exit(); +} else { + if ($action == "showall") { + if ($query == "" || empty($mid)) { + redirect_header("search.php", 1, _SR_PLZENTER); + exit(); + } + } else { + if ($action == "showallbyuser") { + if (empty($mid) || empty($uid)) { + redirect_header("search.php", 1, _SR_PLZENTER); + exit(); + } + } } -} else if ($action == "showallbyuser") { - if (empty($mid) || empty($uid)) { - redirect_header("search.php", 1, _SR_PLZENTER); - exit(); - } } -$groups = is_object($xoopsUser) ? $xoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS; +$groups = $xoops->isUser() ? $xoops->user->getGroups() : XOOPS_GROUP_ANONYMOUS; +/* @var $gperm_handler XoopsGrouppermHandler */ $gperm_handler = xoops_gethandler('groupperm'); $available_modules = $gperm_handler->getItemIds('module_read', $groups); if ($action == 'search') { - include $GLOBALS['xoops']->path('header.php'); - include $GLOBALS['xoops']->path('include/searchform.php'); + $xoops->header(); + include $xoops->path('include/searchform.php'); $search_form->display(); - include $GLOBALS['xoops']->path('footer.php'); + $xoops->footer(); exit(); } if ($andor != "OR" && $andor != "exact" && $andor != "AND") { @@ -118,13 +136,11 @@ } if (count($queries) == 0) { redirect_header('search.php', 2, sprintf(_SR_KEYTOOSHORT, $xoopsConfigSearch['keyword_min'])); - exit(); } } else { $query = trim($query); if (strlen($query) < $xoopsConfigSearch['keyword_min']) { redirect_header('search.php', 2, sprintf(_SR_KEYTOOSHORT, $xoopsConfigSearch['keyword_min'])); - exit(); } $queries = array($myts->addSlashes($query)); } @@ -137,12 +153,11 @@ $criteria->add(new Criteria('mid', "(" . implode(',', $available_modules) . ")", 'IN')); $modules = $module_handler->getObjects($criteria, true); $mids = isset($_REQUEST['mids']) ? $_REQUEST['mids'] : array(); - if (empty($mids) || ! is_array($mids)) { + if (empty($mids) || !is_array($mids)) { unset($mids); $mids = array_keys($modules); } - $xoopsOption['xoops_pagetitle'] = _SR_SEARCHRESULTS . ': ' . implode(' ', $queries); - include $GLOBALS['xoops']->path('header.php'); + $xoops->header(_SR_SEARCHRESULTS . ': ' . implode(' ', $queries)); $nomatch = true; echo "<h3>" . _SR_SEARCHRESULTS . "</h3>\n"; echo _SR_KEYWORDS . ':'; @@ -164,13 +179,14 @@ foreach ($mids as $mid) { $mid = intval($mid); if (in_array($mid, $available_modules)) { + /* @var $module XoopsModule */ $module = $modules[$mid]; $results = $module->search($queries, $andor, 5, 0); $count = count($results); if (is_array($results) && $count > 0) { $nomatch = false; echo "<h4>" . $module->getVar('name') . "</h4>"; - for($i = 0; $i < $count; $i++) { + for ($i = 0; $i < $count; $i++) { if (isset($results[$i]['image']) && $results[$i]['image'] != "") { echo "<img src='modules/" . $module->getVar('dirname') . "/" . $results[$i]['image'] . "' alt='" . $module->getVar('name') . "' /> "; } else { @@ -186,7 +202,8 @@ $uname = XoopsUser::getUnameFromId($results[$i]['uid']); echo " <a href='" . XOOPS_URL . "/userinfo.php?uid=" . $results[$i]['uid'] . "' title=''>" . $uname . "</a>\n"; } - echo !empty($results[$i]['time']) ? " (" . formatTimestamp(intval($results[$i]['time'])) . ")" : ""; + echo !empty($results[$i]['time']) ? " (" . formatTimestamp(intval($results[$i]['time'])) . ")" + : ""; echo "</span><br />\n"; } if ($count >= 5) { @@ -202,13 +219,13 @@ if ($nomatch) { echo "<p>" . _SR_NOMATCH . "</p>"; } - include $GLOBALS['xoops']->path('include/searchform.php'); + include $xoops->path('include/searchform.php'); $search_form->display(); break; case "showall": case 'showallbyuser': - include $GLOBALS['xoops']->path('header.php'); + $xoops->header(); $module_handler = xoops_gethandler('module'); $module = $module_handler->get($mid); $results = $module->search($queries, $andor, 20, $start, $uid); @@ -234,7 +251,7 @@ } printf(_SR_SHOWING, $start + 1, $start + $count); echo "<h5>" . $module->getVar('name') . "</h5>"; - for ($i = 0; $i < $count; $i ++) { + for ($i = 0; $i < $count; $i++) { if (isset($results[$i]['image']) && $results[$i]['image'] != '') { echo "<img src='modules/" . $module->getVar('dirname', "n") . "/" . $results[$i]['image'] . "' alt='" . $module->getVar('name') . "' /> "; } else { @@ -275,9 +292,9 @@ } else { echo '<p>' . _SR_NOMATCH . '</p>'; } - include $GLOBALS['xoops']->path('include/searchform.php'); + include $xoops->path('include/searchform.php'); $search_form->display(); break; } -include $GLOBALS['xoops']->path('footer.php'); +$xoops->footer(); ?> \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/user.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/user.php 2011-10-25 20:06:30 UTC (rev 7960) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/user.php 2011-10-25 20:28:11 UTC (rev 7961) @@ -1,17 +1,14 @@ <?php -/* - You may not change or alter any portion of this comment or credits - of supporting developers from this source code or any supporting source code - which is considered copyrighted (c) material of the 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. -*/ - /** * XOOPS User * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the 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 enclosed file license.txt for licensing information. * If you did not receive this file, get it at http://www.fsf.org/copyleft/gpl.html * @@ -22,10 +19,13 @@ * @author Kazumi Ono <web...@my...> * @version $Id$ */ + include dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mainfile.php'; -$xoopsPreload = XoopsPreload::getInstance(); -$xoopsPreload->triggerEvent('core.user.start'); +$xoops = Xoops::getInstance(); +$xoops->preload = XoopsPreload::getInstance(); +$xoops->preload->triggerEvent('core.user.start'); + xoops_loadLanguage('user'); $op = 'main'; @@ -36,34 +36,32 @@ } if ($op == 'login') { - include_once $GLOBALS['xoops']->path('include/checklogin.php'); + include_once $xoops->path('include/checklogin.php'); exit(); } if ($op == 'main') { - if (!$xoopsUser) { - $xoopsOption['template_main'] = 'system_userform.html'; - include $GLOBALS['xoops']->path('header.php'); - $xoopsTpl->assign('xoops_pagetitle', _LOGIN); - $xoTheme->addMeta('meta', 'keywords', _USERNAME . ", " . _US_PASSWORD . ", " . _US_LOSTPASSWORD); - $xoTheme->addMeta('meta', 'description', _US_LOSTPASSWORD . " " . _US_NOPROBLEM); - $xoopsTpl->assign('lang_login', _LOGIN); - $xoopsTpl->assign('lang_username', _USERNAME); + if (!$xoops->isUser()) { + $xoops->header('system_userform.html'); + $xoops->tpl->assign('xoops_pagetitle', _LOGIN); + $xoops->theme->addMeta('meta', 'keywords', _USERNAME . ", " . _US_PASSWORD . ", " . _US_LOSTPASSWORD); + $xoops->theme->addMeta('meta', 'description', _US_LOSTPASSWORD . " " . _US_NOPROBLEM); + $xoops->tpl->assign('lang_login', _LOGIN); + $xoops->tpl->assign('lang_username', _USERNAME); if (isset($_GET['xoops_redirect'])) { - $xoopsTpl->assign('redirect_page', htmlspecialchars(trim($_GET['xoops_redirect']), ENT_QUOTES)); + $xoops->tpl->assign('redirect_page', htmlspecialchars(trim($_GET['xoops_redirect']), ENT_QUOTES)); } - if ($xoopsConfig['usercookie']) { - $xoopsTpl->assign('lang_rememberme', _US_REMEMBERME); + if ($xoops->config['usercookie']) { + $xoops->tpl->assign('lang_rememberme', _US_REMEMBERME); } - $xoopsTpl->assign('lang_password', _PASSWORD); - $xoopsTpl->assign('lang_notregister', _US_NOTREGISTERED); - $xoopsTpl->assign('lang_lostpassword', _US_LOSTPASSWORD); - $xoopsTpl->assign('lang_noproblem', _US_NOPROBLEM); - $xoopsTpl->assign('lang_youremail', _US_YOUREMAIL); - $xoopsTpl->assign('lang_sendpassword', _US_SENDPASSWORD); - $xoopsTpl->assign('mailpasswd_token', $GLOBALS['xoopsSecurity']->createToken()); - include $GLOBALS['xoops']->path('footer.php'); - exit(); + $xoops->tpl->assign('lang_password', _PASSWORD); + $xoops->tpl->assign('lang_notregister', _US_NOTREGISTERED); + $xoops->tpl->assign('lang_lostpassword', _US_LOSTPASSWORD); + $xoops->tpl->assign('lang_noproblem', _US_NOPROBLEM); + $xoops->tpl->assign('lang_youremail', _US_YOUREMAIL); + $xoops->tpl->assign('lang_sendpassword', _US_SENDPASSWORD); + $xoops->tpl->assign('mailpasswd_token', $xoops->security->createToken()); + $xoops->footer(); } if (!empty($_GET['xoops_redirect'])) { $redirect = trim($_GET['xoops_redirect']); @@ -74,12 +72,12 @@ $isExternal = true; } } - if (! $isExternal) { + if (!$isExternal) { header('Location: ' . $redirect); exit(); } } - header('Location: ' . XOOPS_URL . '/userinfo.php?uid=' . $xoopsUser->getVar('uid')); + header('Location: ' . XOOPS_URL . '/userinfo.php?uid=' . $xoops->user->getVar('uid')); exit(); } @@ -88,43 +86,40 @@ $_SESSION = array(); // Regenerate a new session id and destroy old session session_regenerate_id(true); - setcookie($xoopsConfig['usercookie'], 0, - 1, '/', XOOPS_COOKIE_DOMAIN, 0); - setcookie($xoopsConfig['usercookie'], 0, - 1, '/'); + setcookie($xoops->config['usercookie'], 0, -1, '/', XOOPS_COOKIE_DOMAIN, 0); + setcookie($xoops->config['usercookie'], 0, -1, '/'); // clear entry from online users table - if (is_object($xoopsUser)) { + if ($xoops->isUser()) { + /* @var $online_handler XoopsOnlineHandler */ $online_handler = xoops_gethandler('online'); - $online_handler->destroy($xoopsUser->getVar('uid')); + $online_handler->destroy($xoops->user->getVar('uid')); } $message = _US_LOGGEDOUT . '<br />' . _US_THANKYOUFORVISIT; redirect_header('index.php', 1, $message); - exit(); } if ($op == 'delete') { + /* @var $config_handler XoopsConfigHandler */ $config_handler = xoops_gethandler('config'); $xoopsConfigUser = $config_handler->getConfigsByCat(XOOPS_CONF_USER); - if (!$xoopsUser || $xoopsConfigUser['self_delete'] != 1) { + if (!$xoops->isUser() || $xoopsConfigUser['self_delete'] != 1) { redirect_header('index.php', 5, _US_NOPERMISS); - exit(); } else { - $groups = $xoopsUser->getGroups(); + $groups = $xoops->user->getGroups(); if (in_array(XOOPS_GROUP_ADMIN, $groups)) { // users in the webmasters group may not be deleted redirect_header('user.php', 5, _US_ADMINNO); - exit(); } $ok = !isset($_POST['ok']) ? 0 : intval($_POST['ok']); if ($ok != 1) { - include $GLOBALS['xoops']->path('header.php'); - xoops_confirm( - array('op' => 'delete', 'ok' => 1), - 'user.php', - _US_SURETODEL . '<br/>' . _US_REMOVEINFO); - include $GLOBALS['xoops']->path('footer.php'); + $xoops->header(); + xoops_confirm(array('op' => 'delete', 'ok' => 1), 'user.php', _US_SURETODEL . '<br/>' . _US_REMOVEINFO); + $xoops->footer(); } else { - $del_uid = $xoopsUser->getVar("uid"); + $del_uid = $xoops->user->getVar("uid"); + /* @var $member_handler XoopsMemberHandler */ $member_handler = xoops_gethandler('member'); - if (false != $member_handler->deleteUser($xoopsUser)) { + if (false != $member_handler->deleteUser($xoops->user)) { $online_handler = xoops_gethandler('online'); $online_handler->destroy($del_uid); xoops_notification_deletebyuser($del_uid); @@ -132,7 +127,6 @@ } redirect_header('index.php', 5, _US_NOPERMISS); } - exit(); } } ?> \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/userinfo.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/userinfo.php 2011-10-25 20:06:30 UTC (rev 7960) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/userinfo.php 2011-10-25 20:28:11 UTC (rev 7961) @@ -1,17 +1,14 @@ <?php -/* - You may not change or alter any portion of this comment or credits - of supporting developers from this source code or any supporting source code - which is considered copyrighted (c) material of the 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. -*/ - /** * XOOPS User * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the 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 enclosed file license.txt for licensing information. * If you did not receive this file, get it at http://www.fsf.org/copyleft/gpl.html * @@ -22,6 +19,7 @@ * @author Kazumi Ono <web...@my...> * @version $Id$ */ + include dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mainfile.php'; $xoopsPreload = XoopsPreload::getInstance(); $xoopsPreload->triggerEvent('core.userinfo.start'); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/viewpmsg.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/viewpmsg.php 2011-10-25 20:06:30 UTC (rev 7960) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/viewpmsg.php 2011-10-25 20:28:11 UTC (rev 7961) @@ -17,44 +17,48 @@ */ include dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mainfile.php'; -$xoopsPreload = XoopsPreload::getInstance(); -$xoopsPreload->triggerEvent('core.viewpmsg.start'); +$xoops = Xoops::getInstance(); +$xoops->preload = XoopsPreload::getInstance(); +$xoops->preload->triggerEvent('core.viewpmsg.start'); + xoops_loadLanguage('pmsg'); -if (!is_object($xoopsUser)) { +if (!$xoops->isUser()) { $errormessage = _PM_SORRY . "<br />" . _PM_PLZREG . ""; redirect_header("user.php", 2, $errormessage); } else { $pm_handler = xoops_gethandler('privmessage'); if (isset($_POST['delete_messages']) && isset($_POST['msg_id'])) { - if (!$GLOBALS['xoopsSecurity']->check()) { - echo implode('<br />', $GLOBALS['xoopsSecurity']->getErrors()); + if (!$xoops->security->check()) { + echo implode('<br />', $xoops->security->getErrors()); exit(); - } else if (empty($_REQUEST['ok'])) { - include $GLOBALS['xoops']->path('header.php'); - xoops_confirm(array('ok' => 1, 'delete_messages' => 1, 'msg_id'=> serialize(array_map("intval", $_POST['msg_id']))), $_SERVER['REQUEST_URI'], _PM_SURE_TO_DELETE); - include $GLOBALS['xoops']->path('footer.php'); - exit(); + } else { + if (empty($_REQUEST['ok'])) { + $xoops->header(); + xoops_confirm(array( + 'ok' => 1, 'delete_messages' => 1, 'msg_id' => serialize(array_map("intval", $_POST['msg_id'])) + ), $_SERVER['REQUEST_URI'], _PM_SURE_TO_DELETE); + $xoops->footer(); + } } $_POST['msg_id'] = unserialize($_REQUEST['msg_id']); $size = count($_POST['msg_id']); $msg = $_POST['msg_id']; - for($i = 0; $i < $size; $i++) { + for ($i = 0; $i < $size; $i++) { $pm = $pm_handler->get(intval($msg[$i])); - if ($pm->getVar('to_userid') == $xoopsUser->getVar('uid')) { + if ($pm->getVar('to_userid') == $xoops->user->getVar('uid')) { $pm_handler->delete($pm); } unset($pm); } redirect_header("viewpmsg.php", 1, _PM_DELETED); - exit(); } - include $GLOBALS['xoops']->path('header.php'); - $criteria = new Criteria('to_userid', $xoopsUser->getVar('uid')); + $xoops->header(); + $criteria = new Criteria('to_userid', $xoops->user->getVar('uid')); $criteria->setOrder('DESC'); $pm_arr = $pm_handler->getObjects($criteria); - echo "<h4 class='txtcenter'>" . _PM_PRIVATEMESSAGE . "</h4><br /><a href='userinfo.php?uid=" . $xoopsUser->getVar("uid") . "'>" . _PM_PROFILE . "</a> <span style='font-weight:bold;'>»»</span> " . _PM_INBOX . "<br /><br />"; + echo "<h4 class='txtcenter'>" . _PM_PRIVATEMESSAGE . "</h4><br /><a href='userinfo.php?uid=" . $xoops->user->getVar("uid") . "'>" . _PM_PROFILE . "</a> <span style='font-weight:bold;'>»»</span> " . _PM_INBOX . "<br /><br />"; echo "<form name='prvmsg' method='post' action='viewpmsg.php'>"; echo "<table cellspacing='1' cellpadding='4' class='outer width100 bnone'>\n"; echo "<tr align='center' valign='middle'><th><input name='allbox' id='allbox' onclick='xoopsCheckAll(\"prvmsg\", \"allbox\");' type='checkbox' value='Check All' /></th><th><img class'bnone' src='images/download.gif' alt=''/></th><th> </th><th>" . _PM_FROM . "</th><th>" . _PM_SUBJECT . "</th><th class='txtcenter'>" . _PM_DATE . "</th></tr>\n"; @@ -65,7 +69,7 @@ } else { $display = 1; } - for($i = 0; $i < $total_messages; $i++) { + for ($i = 0; $i < $total_messages; $i++) { $class = ($i % 2 == 0) ? 'even' : 'odd'; echo "<tr class='$class txtleft'><td class='aligntop width2 txtcenter'><input type='checkbox' id='msg_id[]' name='msg_id[]' value='" . $pm_arr[$i]->getVar("msg_id") . "' /></td>\n"; if ($pm_arr[$i]->getVar('read_msg') == 1) { @@ -73,30 +77,29 @@ } else { echo "<td class='aligntop width5 txtcenter'><img src='images/email_notread.png' alt='" . _PM_NOTREAD . "' title='" . _PM_NOTREAD . "' /></td>\n"; } - $iconName=$pm_arr[$i]->getVar("msg_image", "E"); + $iconName = $pm_arr[$i]->getVar("msg_image", "E"); if ($iconName != '') { - echo "<td class='aligntop width5 txtcenter'><img src='images/subject/" . $iconName . "' alt='' /></td>\n"; + echo "<td class='aligntop width5 txtcenter'><img src='images/subject/" . $iconName . "' alt='' /></td>\n"; + } else { + echo "<td class='aligntop width5 txtcenter'></td>\n"; } - else { - echo "<td class='aligntop width5 txtcenter'></td>\n"; - } $postername = XoopsUser::getUnameFromId($pm_arr[$i]->getVar("from_userid")); echo "<td class='alignmiddle width10'>"; // no need to show deleted users if ($postername) { echo "<a href='userinfo.php?uid=" . $pm_arr[$i]->getVar("from_userid") . "' title=''>" . $postername . "</a>"; } else { - echo $xoopsConfig['anonymous']; + echo $xoops->config['anonymous']; } echo "</td>\n"; echo "<td class='alignmiddle'><a href='readpmsg.php?start=" . ($total_messages - $i - 1), "&total_messages=$total_messages'>" . $pm_arr[$i]->getVar("subject") . "</a></td>"; echo "<td class='alignmiddle txtcenter width20'>" . formatTimestamp($pm_arr[$i]->getVar("msg_time")) . "</td></tr>"; } if ($display == 1) { - echo "<tr class='foot txtleft'><td colspan='6' align='left'><input type='button' class='formButton' onclick='javascript:openWithSelfMain(\"" . XOOPS_URL . "/pmlite.php?send=1\",\"pmlite\",565,500);' value='" . _PM_SEND . "' /> <input type='submit' class='formButton' name='delete_messages' value='" . _PM_DELETE . "' />" . $GLOBALS['xoopsSecurity']->getTokenHTML() . "</td></tr></table></form>"; + echo "<tr class='foot txtleft'><td colspan='6' align='left'><input type='button' class='formButton' onclick='javascript:openWithSelfMain(\"" . XOOPS_URL . "/pmlite.php?send=1\",\"pmlite\",565,500);' value='" . _PM_SEND . "' /> <input type='submit' class='formButton' name='delete_messages' value='" . _PM_DELETE . "' />" . $xoops->security->getTokenHTML() . "</td></tr></table></form>"; } else { echo "<tr class='bg2 txtleft'><td class='txtleft' colspan='6'><input type='button' class='formButton' onclick='javascript:openWithSelfMain(\"" . XOOPS_URL . "/pmlite.php?send=1\",\"pmlite\",565,500);' value='" . _PM_SEND . "' /></td></tr></table></form>"; } - include $GLOBALS['xoops']->path('footer.php'); + $xoops->footer(); } ?> \ No newline at end of file Deleted: XoopsCore/branches/2.6.x/2.6.0/htdocs/xmlrpc.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/xmlrpc.php 2011-10-25 20:06:30 UTC (rev 7960) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/xmlrpc.php 2011-10-25 20:28:11 UTC (rev 7961) @@ -1,65 +0,0 @@ -<?php -/** - * XOOPS XMLRPC - * - * You may not change or alter any portion of this comment or credits - * of supporting developers from this source code or any supporting source code - * which is considered copyrighted (c) material of the 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. - * - * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ - * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) - * @package core - * @since 2.0.0 - * @version $Id$ - */ - -define('XOOPS_XMLRPC', 1); - -include dirname(__FILE__). DIRECTORY_SEPARATOR . 'mainfile.php'; - -error_reporting(0); - -$GLOBALS['xoopsLogger']->activate(false); - -$response = new XoopsXmlRpcResponse(); -$parser = new XoopsXmlRpcParser(rawurlencode($GLOBALS['HTTP_RAW_POST_DATA'])); -if (!$parser->parse()) { - $response->add(new XoopsXmlRpcFault(102)); -} else { - $module_handler = xoops_gethandler('module'); - $module = $module_handler->getByDirname('news'); - if (!is_object($module)) { - $response->add(new XoopsXmlRpcFault(110)); - } else { - $methods = explode('.', $parser->getMethodName()); - switch ($methods[0]) { - case 'blogger': - break; - case 'metaWeblog': - $rpc_api = new MetaWeblogApi($parser->getParam(), $response, $module); - break; - case 'mt': - $rpc_api = new MovableTypeApi($parser->getParam(), $response, $module); - break; - case 'xoops': - default: - $rpc_api = new XoopsApi($parser->getParam(), $response, $module); - break; - } - $method = $methods[1]; - if (!method_exists($rpc_api, $method)) { - $response->add(new XoopsXmlRpcFault(107)); - } else { - $rpc_api->$method(); - } - } -} -$payload = $response->render(); -header('Server: XOOPS XML-RPC Server'); -header('Content-type: text/xml'); -header('Content-Length: ' . strlen($payload)); -echo $payload; -?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |