From: <txm...@us...> - 2015-03-14 18:51:16
|
Revision: 13016 http://sourceforge.net/p/xoops/svn/13016 Author: txmodxoops Date: 2015-03-14 18:51:12 +0000 (Sat, 14 Mar 2015) Log Message: ----------- Updated profile module with .tpl extension templates Captcha and Recaptcha Modificed admin protector for bootstrap Deleted .html templates files Modified Paths: -------------- XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/class/theme.php Added Paths: ----------- XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/class/captcha/ XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/class/captcha/config.php XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/class/captcha/config.recaptcha.php XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/activate.php XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/admin/ XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/admin/about.php XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/admin/admin_footer.php XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/admin/admin_header.php XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/admin/category.php XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/admin/deactivate.php XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/admin/field.php XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/admin/index.html XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/admin/index.php XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/admin/menu.php XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/admin/permissions.php XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/admin/step.php XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/admin/user.php XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/admin/visibility.php XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/assets/ XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/assets/css/ XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/assets/css/index.html XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/assets/css/style.css XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/assets/images/ XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/assets/images/actions/ XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/assets/images/actions/0.png XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/assets/images/actions/1.png XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/assets/images/actions/index.html XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/assets/images/index.html XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/assets/images/left_both.gif XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/assets/images/logo.png XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/assets/images/modadminbg.gif XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/assets/images/no.png XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/assets/images/right_both.gif XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/assets/images/yes.png XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/assets/index.html XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/assets/js/ XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/assets/js/index.html XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/changemail.php XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/changepass.php XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/class/ XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/class/category.php XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/class/field.php XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/class/index.html XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/class/profile.php XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/class/regstep.php XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/class/visibility.php XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/docs/ XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/docs/changelog.txt XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/docs/credits.txt XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/docs/index.html XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/docs/install.txt XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/docs/lang_diff.txt XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/docs/licence.txt XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/docs/readme.txt XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/edituser.php XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/footer.php XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/header.php XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/include/ XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/include/forms.php XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/include/index.html XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/include/install.php XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/include/update.php XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/index.php XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/language/ XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/language/english/ XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/language/english/admin.php XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/language/english/help/ XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/language/english/help/help.html XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/language/english/help/index.html XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/language/english/index.html XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/language/english/mail_template/ XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/language/english/mail_template/emailchanged.tpl XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/language/english/mail_template/index.html XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/language/english/main.php XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/language/english/modinfo.php XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/language/index.html XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/lostpass.php XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/preloads/ XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/preloads/core.php XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/preloads/index.html XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/register.php XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/search.php XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/sql/ XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/sql/index.html XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/sql/mysql.sql XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/templates/profile_admin_categorylist.tpl XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/templates/profile_admin_fieldlist.tpl XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/templates/profile_admin_steplist.tpl XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/templates/profile_admin_visibility.tpl XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/templates/profile_avatar.tpl XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/templates/profile_breadcrumbs.tpl XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/templates/profile_changepass.tpl XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/templates/profile_editprofile.tpl XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/templates/profile_email.tpl XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/templates/profile_form.tpl XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/templates/profile_register.tpl XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/templates/profile_results.tpl XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/templates/profile_search.tpl XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/templates/profile_userform.tpl XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/templates/profile_userinfo.tpl XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/user.php XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/userinfo.php XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/xoops_version.php XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/xoops_lib/modules/ XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/xoops_lib/modules/protector/ XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/xoops_lib/modules/protector/admin/ XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/xoops_lib/modules/protector/admin/center.php XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/xoops_lib/modules/protector/admin/prefix_manager.php Removed Paths: ------------- XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/templates/profile_admin_categorylist.html XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/templates/profile_admin_fieldlist.html XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/templates/profile_admin_steplist.html XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/templates/profile_admin_visibility.html XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/templates/profile_avatar.html XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/templates/profile_breadcrumbs.html XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/templates/profile_changepass.html XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/templates/profile_editprofile.html XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/templates/profile_email.html XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/templates/profile_form.html XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/templates/profile_register.html XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/templates/profile_results.html XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/templates/profile_search.html XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/templates/profile_userform.html XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/templates/profile_userinfo.html XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/system/themes/dashboard/xotpl/theme_bccenter.html XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/system/themes/dashboard/xotpl/theme_bcleft.html XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/system/themes/dashboard/xotpl/theme_bcright.html XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/system/themes/dashboard/xotpl/theme_bleft.html XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/system/themes/dashboard/xotpl/theme_bright.html Added: XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/class/captcha/config.php =================================================================== --- XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/class/captcha/config.php (rev 0) +++ XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/class/captcha/config.php 2015-03-14 18:51:12 UTC (rev 13016) @@ -0,0 +1,33 @@ +<?php +/** + * CAPTCHA configurations for All modes + * + * 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 (c) 2000-2014 XOOPS Project (www.xoops.org) + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package class + * @subpackage CAPTCHA + * @since 2.3.0 + * @author Taiwen Jiang <ph...@us...> + * @version $Id: config.php 12666 2014-06-30 10:02:07Z beckmi $ + */ + +defined('XOOPS_ROOT_PATH') || die('Restricted access'); + +/** + * This keeping config in files has really got to stop. If we can't actually put these into + * the actual XOOPS config then we should do this. (Who said this? You are right!) + */ +return $config = array( + 'disabled' => $GLOBALS['xoopsModuleConfig']['captcha_disabled'], // Disable CAPTCHA false + 'mode' => $GLOBALS['xoopsModuleConfig']['captcha_mode'], // default mode, you can choose 'text', 'image', 'recaptcha'(requires api key) + 'name' => $GLOBALS['xoopsModuleConfig']['captcha_name'], // default captcha name xoopscaptcha + 'skipmember' => $GLOBALS['xoopsModuleConfig']['captcha_skipmember'], // Skip CAPTCHA check for members true + 'maxattempts' => $GLOBALS['xoopsModuleConfig']['captcha_maxattempts'], // Maximum attempts for each session default 10 +); Added: XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/class/captcha/config.recaptcha.php =================================================================== --- XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/class/captcha/config.recaptcha.php (rev 0) +++ XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/class/captcha/config.recaptcha.php 2015-03-14 18:51:12 UTC (rev 13016) @@ -0,0 +1,28 @@ +<?php +/** + * CAPTCHA configurations for Recaptcha mode + * + * 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 (c) 2000-2014 XOOPS Project (www.xoops.org) + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package class + * @subpackage CAPTCHA + * @since 2.5.2 + * @author trabis <lus...@gm...> + * @version $Id: config.recaptcha.php 13018 2015-03-15 18:32:47Z timgno $ + */ + +defined('XOOPS_ROOT_PATH') || die('Restricted access'); + +return $config = array( + 'private_key' => $GLOBALS['xoopsModuleConfig']['recaptcha_private_apikey'], //'YourPrivateApiKey' + 'public_key' => $GLOBALS['xoopsModuleConfig']['recaptcha_public_apikey'], //'YourPublicApiKey', + 'theme' => $GLOBALS['xoopsModuleConfig']['recaptcha_theme'], // 'red' | 'white' | 'blackglass' | 'clean' | 'custom' + 'lang' => _LANGCODE + ); Modified: XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/class/theme.php =================================================================== --- XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/class/theme.php 2015-03-14 11:55:46 UTC (rev 13015) +++ XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/class/theme.php 2015-03-14 18:51:12 UTC (rev 13016) @@ -16,7 +16,7 @@ * @since 2.3.0 * @package kernel * @subpackage xos_opal_Theme - * @version $Id: theme.php 12666 2014-06-30 10:02:07Z beckmi $ + * @version $Id: theme.php 13015 2015-03-14 12:56:47Z timgno $ */ defined('XOOPS_ROOT_PATH') || die('Restricted access'); Added: XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/activate.php =================================================================== --- XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/activate.php (rev 0) +++ XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/activate.php 2015-03-14 18:51:12 UTC (rev 13016) @@ -0,0 +1,109 @@ +<?php +/** + * Extended User Profile + * + * 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 profile + * @since 2.3.0 + * @author Jan Pedersen + * @author Taiwen Jiang <ph...@us...> + * @version $Id: activate.php 12033 2013-09-14 03:16:44Z beckmi $ + */ + +$xoopsOption['pagetype'] = "user"; +include dirname(__FILE__) . DIRECTORY_SEPARATOR . 'header.php'; + +include $GLOBALS['xoops']->path('header.php'); +if (!empty($_GET['id']) && !empty($_GET['actkey'])) { + $id = intval($_GET['id']); + $actkey = trim($_GET['actkey']); + if (empty($id)) { + redirect_header(XOOPS_URL, 1, ''); + exit(); + } + $member_handler =& xoops_gethandler('member'); + $thisuser =& $member_handler->getUser($id); + if (!is_object($thisuser)) { + redirect_header(XOOPS_URL, 1, ''); + exit(); + } + if ($thisuser->getVar('actkey') != $actkey) { + redirect_header(XOOPS_URL . '/', 5, _US_ACTKEYNOT); + } else { + if ($thisuser->getVar('level') > 0) { + redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['xoopsModule']->getVar('dirname', 'n'). '/index.php', 5, _US_ACONTACT, false); + } else { + if (false != $member_handler->activateUser($thisuser)) { + $config_handler =& xoops_gethandler('config'); + $GLOBALS['xoopsConfigUser'] = $config_handler->getConfigsByCat(XOOPS_CONF_USER); + if ($GLOBALS['xoopsConfigUser']['activation_type'] == 2) { + $myts =& MyTextSanitizer::getInstance(); + $xoopsMailer = xoops_getMailer(); + $xoopsMailer->useMail(); + $xoopsMailer->setTemplate('activated.tpl'); + $xoopsMailer->assign('SITENAME', $GLOBALS['xoopsConfig']['sitename']); + $xoopsMailer->assign('ADMINMAIL', $GLOBALS['xoopsConfig']['adminmail']); + $xoopsMailer->assign('SITEURL', XOOPS_URL . "/"); + $xoopsMailer->setToUsers($thisuser); + $xoopsMailer->setFromEmail($GLOBALS['xoopsConfig']['adminmail']); + $xoopsMailer->setFromName($GLOBALS['xoopsConfig']['sitename']); + $xoopsMailer->setSubject(sprintf(_US_YOURACCOUNT, $GLOBALS['xoopsConfig']['sitename']) ); + include $GLOBALS['xoops']->path('header.php'); + if (!$xoopsMailer->send()) { + printf(_US_ACTVMAILNG, $thisuser->getVar('uname') ); + } else { + printf(_US_ACTVMAILOK, $thisuser->getVar('uname') ); + } + include dirname(__FILE__) . DIRECTORY_SEPARATOR . 'footer.php'; + } else { + redirect_header(XOOPS_URL . '/user.php', 5, _US_ACTLOGIN, false); + } + } else { + redirect_header(XOOPS_URL . '/index.php', 5, 'Activation failed!'); + } + } + } +// Not implemented yet: re-send activiation code +} else if (!empty($_REQUEST['email']) && $xoopsConfigUser['activation_type'] != 0) { + $myts =& MyTextSanitizer::getInstance(); + $member_handler =& xoops_gethandler('member'); + $getuser =& $member_handler->getUsers(new Criteria('email', $myts->addSlashes(trim($_REQUEST['email'])))); + if (count($getuser) == 0) { + redirect_header(XOOPS_URL, 2, _US_SORRYNOTFOUND); + } + if ($getuser[0]->isActive()) { + redirect_header(XOOPS_URL, 2, sprintf(_US_USERALREADYACTIVE, $getuser[0]->getVar('email'))); + } + $xoopsMailer =& xoops_getMailer(); + $xoopsMailer->useMail(); + $xoopsMailer->setTemplate('register.tpl'); + $xoopsMailer->assign('SITENAME', $GLOBALS['xoopsConfig']['sitename']); + $xoopsMailer->assign('ADMINMAIL', $GLOBALS['xoopsConfig']['adminmail']); + $xoopsMailer->assign('SITEURL', XOOPS_URL . "/"); + $xoopsMailer->setToUsers($getuser[0]); + $xoopsMailer->setFromEmail($GLOBALS['xoopsConfig']['adminmail']); + $xoopsMailer->setFromName($GLOBALS['xoopsConfig']['sitename']); + $xoopsMailer->setSubject(sprintf(_US_USERKEYFOR, $getuser[0]->getVar('uname') )); + if (!$xoopsMailer->send()) { + echo _US_YOURREGMAILNG; + } else { + echo _US_YOURREGISTERED; + } +} else { + include_once $GLOBALS['xoops']->path('class/xoopsformloader.php'); + $form = new XoopsThemeForm('', 'form', 'activate.php'); + $form->addElement(new XoopsFormText(_US_EMAIL, 'email', 25, 255) ); + $form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit') ); + $form->display(); +} + +$xoBreadcrumbs[] = array('title' => _PROFILE_MA_REGISTER); +include dirname(__FILE__) . DIRECTORY_SEPARATOR . 'footer.php'; Added: XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/admin/about.php =================================================================== --- XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/admin/about.php (rev 0) +++ XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/admin/about.php 2015-03-14 18:51:12 UTC (rev 13016) @@ -0,0 +1,31 @@ +<?php +/** + * XOOPS Profile module + * + * 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://www.xoops.org) + * @license GNU GPL (http://www.gnu.org/licenses/gpl-2.0.html/) + * @package xoopsPoll + * @since 2.5.0 + * @author Mage, Mamba + * @version $Id $ + **/ + +include '../../../include/cp_header.php'; +include 'admin_header.php'; +xoops_cp_header(); + +$module_info =& $module_handler->get($xoopsModule->getVar("mid")); + +$aboutAdmin = new ModuleAdmin(); + +echo $aboutAdmin->addNavigation('about.php'); +echo $aboutAdmin->renderabout('6KJ7RW5DR3VTJ', false); + +include 'admin_footer.php'; Added: XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/admin/admin_footer.php =================================================================== --- XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/admin/admin_footer.php (rev 0) +++ XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/admin/admin_footer.php 2015-03-14 18:51:12 UTC (rev 13016) @@ -0,0 +1,27 @@ +<?php +/** + * Extended User Profile + * + * 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 profile + * @since 2.3.0 + * @author Jan Pedersen + * @author Taiwen Jiang <ph...@us...> + * @version $Id: admin_footer.php 13016 2015-03-15 18:21:22Z timgno $ + */ +echo "<div class='adminfooter'>\n" + ." <div style='text-align: center;'>\n" + ." <a href='http://www.xoops.org' rel='external'><img src='{$pathIcon32}/xoopsmicrobutton.gif' alt='XOOPS' title='XOOPS'></a>\n" + ." </div>\n" + ." " . _AM_MODULEADMIN_ADMIN_FOOTER . "\n" + ."</div>"; + +xoops_cp_footer(); Added: XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/admin/admin_header.php =================================================================== --- XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/admin/admin_header.php (rev 0) +++ XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/admin/admin_header.php 2015-03-14 18:51:12 UTC (rev 13016) @@ -0,0 +1,54 @@ +<?php +/** + * Extended User Profile + * + * 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 profile + * @since 2.3.0 + * @author Taiwen Jiang <ph...@us...> + * @version $Id: admin_header.php 12363 2014-03-08 10:39:06Z beckmi $ + */ + +$path = dirname(dirname(dirname(dirname(__FILE__)))); +include_once $path . '/mainfile.php'; +include_once $path . '/include/cp_functions.php'; +require_once $path . '/include/cp_header.php'; + +global $xoopsModule; + +$thisModuleDir = $GLOBALS['xoopsModule']->getVar('dirname'); + +//if functions.php file exist +//require_once dirname(dirname(__FILE__)) . '/include/functions.php'; + +// Load language files +xoops_loadLanguage('admin', $thisModuleDir); +xoops_loadLanguage('modinfo', $thisModuleDir); +xoops_loadLanguage('main', $thisModuleDir); + +$pathIcon16 = '../'.$xoopsModule->getInfo('icons16'); +$pathIcon32 = '../'.$xoopsModule->getInfo('icons32'); +$pathModuleAdmin = $xoopsModule->getInfo('dirmoduleadmin'); + +$myts =& MyTextSanitizer::getInstance(); + +if (!isset($xoopsTpl) || !is_object($xoopsTpl)) { + include_once XOOPS_ROOT_PATH . "/class/template.php"; + $xoopsTpl = new XoopsTpl(); +} + +include_once $GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php'); + +xoops_loadLanguage('user'); +if ( !isset($GLOBALS['xoopsTpl']) || !is_object($GLOBALS['xoopsTpl']) ) { + include_once $GLOBALS['xoops']->path( "/class/template.php" ); + $GLOBALS['xoopsTpl'] = new XoopsTpl(); +} \ No newline at end of file Added: XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/admin/category.php =================================================================== --- XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/admin/category.php (rev 0) +++ XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/admin/category.php 2015-03-14 18:51:12 UTC (rev 13016) @@ -0,0 +1,96 @@ +<?php +/** + * Extended User Profile + * + * 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 profile + * @since 2.3.0 + * @author Jan Pedersen + * @author Taiwen Jiang <ph...@us...> + * @version $Id: permissions.php 13016 2015-03-15 18:21:22Z timgno $ + */ +include 'admin_header.php'; +xoops_cp_header(); +$indexAdmin = new ModuleAdmin(); + +$indexAdmin->addItemButton(_ADD . ' ' . _AM_PROFILE_CATEGORY, 'category.php?op=new', 'add', ''); + +echo $indexAdmin->addNavigation('category.php'); +echo $indexAdmin->renderButton('right', ''); + +$op = isset($_REQUEST['op']) ? $_REQUEST['op'] : (isset($_REQUEST['id']) ? "edit" : 'list'); + +$handler =& xoops_getmodulehandler('category'); +switch ($op) { +default: +case "list": + $criteria = new CriteriaCompo(); + $criteria->setSort('cat_weight'); + $criteria->setOrder('ASC'); + $GLOBALS['xoopsTpl']->assign('categories', $handler->getObjects($criteria, true, false) ); + $template_main = "profile_admin_categorylist.tpl"; + break; + +case "new": + include_once '../include/forms.php'; + $obj =& $handler->create(); + $form = $obj->getForm(); + $form->display(); + break; + +case "edit": + include_once '../include/forms.php'; + $obj = $handler->get($_REQUEST['id']); + $form = $obj->getForm(); + $form->display(); + break; + +case "save": + if ( !$GLOBALS['xoopsSecurity']->check() ) { + redirect_header('category.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors() )); + } + if ( isset($_REQUEST['id']) ) { + $obj =& $handler->get($_REQUEST['id']); + } else { + $obj =& $handler->create(); + } + $obj->setVar('cat_title', $_REQUEST['cat_title']); + $obj->setVar('cat_description', $_REQUEST['cat_description']); + $obj->setVar('cat_weight', $_REQUEST['cat_weight']); + if ( $handler->insert($obj) ) { + redirect_header('category.php', 3, sprintf(_AM_PROFILE_SAVEDSUCCESS, _AM_PROFILE_CATEGORY) ); + } + include_once '../include/forms.php'; + echo $obj->getHtmlErrors(); + $form =& $obj->getForm(); + $form->display(); + break; + +case "delete": + $obj =& $handler->get($_REQUEST['id']); + if ( isset($_REQUEST['ok']) && $_REQUEST['ok'] == 1 ) { + if ( !$GLOBALS['xoopsSecurity']->check() ) { + redirect_header('category.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors() )); + } + if ( $handler->delete($obj) ) { + redirect_header('category.php', 3, sprintf(_AM_PROFILE_DELETEDSUCCESS, _AM_PROFILE_CATEGORY) ); + } else { + echo $obj->getHtmlErrors(); + } + } else { + xoops_confirm(array('ok' => 1, 'id' => $_REQUEST['id'], 'op' => 'delete'), $_SERVER['REQUEST_URI'], sprintf(_AM_PROFILE_RUSUREDEL, $obj->getVar('cat_title') )); + } + break; +} +if ( isset($template_main) ) { + $GLOBALS['xoopsTpl']->display("db:{$template_main}"); +} +include 'admin_footer.php'; Added: XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/admin/deactivate.php =================================================================== --- XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/admin/deactivate.php (rev 0) +++ XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/admin/deactivate.php 2015-03-14 18:51:12 UTC (rev 13016) @@ -0,0 +1,31 @@ +<?php +include 'admin_header.php'; +xoops_cp_header(); + +if ( !isset($_REQUEST['uid']) ) { + redirect_header("index.php", 2, _PROFILE_AM_NOSELECTION); +} +$member_handler = xoops_gethandler('member'); +$user = $member_handler->getUser($_REQUEST['uid']); +if ( !$user || $user->isNew() ) { + redirect_header("index.php", 2, _PROFILE_AM_USERDONEXIT); +} + +if ( in_array(XOOPS_GROUP_ADMIN, $user->getGroups() ) ) { + redirect_header("index.php", 2, _PROFILE_AM_CANNOTDEACTIVATEWEBMASTERS); +} +$user->setVar('level', $_REQUEST['level']); +if ( $member_handler->insertUser($user) ) { + if ( $_REQUEST['level'] == 1 ) { + $message = _PROFILE_AM_USER_ACTIVATED; + } else { + $message = _PROFILE_AM_USER_DEACTIVATED; + } +} else { + if ( $_REQUEST['level'] == 1 ) { + $message = _PROFILE_AM_USER_NOT_ACTIVATED; + } else { + $message = _PROFILE_AM_USER_NOT_DEACTIVATED; + } +} +redirect_header("../userinfo.php?uid=" . $user->getVar('uid'), 3, $message); Added: XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/admin/field.php =================================================================== --- XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/admin/field.php (rev 0) +++ XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/admin/field.php 2015-03-14 18:51:12 UTC (rev 13016) @@ -0,0 +1,338 @@ +<?php +/** + * Extended User Profile + * + * 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 profile + * @since 2.3.0 + * @author Jan Pedersen + * @author Taiwen Jiang <ph...@us...> + * @version $Id: field.php 13016 2015-03-15 18:21:22Z timgno $ + */ +include 'admin_header.php'; +xoops_cp_header(); +$indexAdmin = new ModuleAdmin(); + +$indexAdmin->addItemButton(_ADD . ' ' . _AM_PROFILE_FIELD, 'field.php?op=new', 'add', ''); + +echo $indexAdmin->addNavigation('field.php'); +echo $indexAdmin->renderButton('right', ''); + +$op = isset($_REQUEST['op']) ? $_REQUEST['op'] : (isset($_REQUEST['id']) ? "edit" : 'list'); + +$profilefield_handler =& xoops_getmodulehandler('field'); + +switch ($op) { + default: + case "list": + $fields = $profilefield_handler->getObjects(null, true, false); + + $module_handler =& xoops_gethandler('module'); + $modules = $module_handler->getObjects(null, true); + + $cat_handler =& xoops_getmodulehandler('category'); + $criteria = new CriteriaCompo(); + $criteria->setSort('cat_weight'); + $cats = $cat_handler->getObjects($criteria, true); + unset($criteria); + + $categories[0] = _AM_PROFILE_DEFAULT; + if (count($cats) > 0) { + foreach (array_keys($cats) as $i) { + $categories[$cats[$i]->getVar('cat_id')] = $cats[$i]->getVar('cat_title'); + } + } + $GLOBALS['xoopsTpl']->assign('categories', $categories); + unset($categories); + $valuetypes = array( XOBJ_DTYPE_ARRAY => _AM_PROFILE_ARRAY, + XOBJ_DTYPE_EMAIL => _AM_PROFILE_EMAIL, + XOBJ_DTYPE_INT => _AM_PROFILE_INT, + XOBJ_DTYPE_TXTAREA => _AM_PROFILE_TXTAREA, + XOBJ_DTYPE_TXTBOX => _AM_PROFILE_TXTBOX, + XOBJ_DTYPE_URL => _AM_PROFILE_URL, + XOBJ_DTYPE_OTHER => _AM_PROFILE_OTHER, + XOBJ_DTYPE_MTIME => _AM_PROFILE_DATE ); + + $fieldtypes = array('checkbox' => _AM_PROFILE_CHECKBOX, + 'group' => _AM_PROFILE_GROUP, + 'group_multi' => _AM_PROFILE_GROUPMULTI, + 'language' => _AM_PROFILE_LANGUAGE, + 'radio' => _AM_PROFILE_RADIO, + 'select' => _AM_PROFILE_SELECT, + 'select_multi' => _AM_PROFILE_SELECTMULTI, + 'textarea' => _AM_PROFILE_TEXTAREA, + 'dhtml' => _AM_PROFILE_DHTMLTEXTAREA, + 'textbox' => _AM_PROFILE_TEXTBOX, + 'timezone' => _AM_PROFILE_TIMEZONE, + 'yesno' => _AM_PROFILE_YESNO, + 'date' => _AM_PROFILE_DATE, + 'datetime' => _AM_PROFILE_DATETIME, + 'longdate' => _AM_PROFILE_LONGDATE, + 'theme' => _AM_PROFILE_THEME, + 'autotext' => _AM_PROFILE_AUTOTEXT, + 'rank' => _AM_PROFILE_RANK); + + foreach (array_keys($fields) as $i) { + $fields[$i]['canEdit']=$fields[$i]['field_config'] || $fields[$i]['field_show'] || $fields[$i]['field_edit']; + $fields[$i]['canDelete'] = $fields[$i]['field_config']; + $fields[$i]['fieldtype'] = $fieldtypes[$fields[$i]['field_type']]; + $fields[$i]['valuetype'] = $valuetypes[$fields[$i]['field_valuetype']]; + $categories[$fields[$i]['cat_id']][] = $fields[$i]; + $weights[$fields[$i]['cat_id']][] = $fields[$i]['field_weight']; + + } + //sort fields order in categories + foreach (array_keys($categories) as $i) { + array_multisort($weights[$i], SORT_ASC, array_keys($categories[$i]), SORT_ASC, $categories[$i]); + } + ksort($categories); + $GLOBALS['xoopsTpl']->assign('fieldcategories', $categories); + $GLOBALS['xoopsTpl']->assign('token', $GLOBALS['xoopsSecurity']->getTokenHTML()); + $template_main = "profile_admin_fieldlist.tpl"; + break; + + case "new": + include_once '../include/forms.php'; + $obj =& $profilefield_handler->create(); + $form = profile_getFieldForm($obj); + $form->display(); + break; + + case "edit": + $obj =& $profilefield_handler->get($_REQUEST['id']); + if (!$obj->getVar('field_config') && !$obj->getVar('field_show') && !$obj->getVar('field_edit')) { //If no configs exist + redirect_header('field.php', 2, _AM_PROFILE_FIELDNOTCONFIGURABLE); + } + include_once '../include/forms.php'; + $form = profile_getFieldForm($obj); + $form->display(); + break; + + case "reorder": + if (!$GLOBALS['xoopsSecurity']->check()) { + redirect_header('field.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors())); + } + if (isset($_POST['field_ids']) && count($_POST['field_ids']) > 0) { + $oldweight = $_POST['oldweight']; + $oldcat = $_POST['oldcat']; + $category = $_POST['category']; + $weight = $_POST['weight']; + $ids = array(); + foreach ($_POST['field_ids'] as $field_id) { + if ($oldweight[$field_id] != $weight[$field_id] || $oldcat[$field_id] != $category[$field_id]) { + //if field has changed + $ids[] = intval($field_id); + } + } + if (count($ids) > 0) { + $errors = array(); + //if there are changed fields, fetch the fieldcategory objects + $field_handler =& xoops_getmodulehandler('field'); + $fields = $field_handler->getObjects(new Criteria('field_id', "(" . implode(',', $ids) . ")", "IN"), true); + foreach ($ids as $i) { + $fields[$i]->setVar('field_weight', intval($weight[$i])); + $fields[$i]->setVar('cat_id', intval($category[$i])); + if (!$field_handler->insert($fields[$i])) { + $errors = array_merge($errors, $fields[$i]->getErrors()); + } + } + if (count($errors) == 0) { + //no errors + redirect_header('field.php', 2, sprintf(_AM_PROFILE_SAVEDSUCCESS, _AM_PROFILE_FIELDS)); + } else { + redirect_header('field.php', 3, implode('<br />', $errors)); + } + } + } + break; + + case "save": + if (!$GLOBALS['xoopsSecurity']->check()) { + redirect_header('field.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors())); + } + $redirect_to_edit = false; + if (isset($_REQUEST['id'])) { + $obj =& $profilefield_handler->get($_REQUEST['id']); + if (!$obj->getVar('field_config') && !$obj->getVar('field_show') && !$obj->getVar('field_edit')) { //If no configs exist + redirect_header('admin.php', 2, _AM_PROFILE_FIELDNOTCONFIGURABLE); + } + } else { + $obj =& $profilefield_handler->create(); + $obj->setVar('field_name', $_REQUEST['field_name']); + $obj->setVar('field_moduleid', $GLOBALS['xoopsModule']->getVar('mid')); + $obj->setVar('field_show', 1); + $obj->setVar('field_edit', 1); + $obj->setVar('field_config', 1); + $redirect_to_edit = true; + } + $obj->setVar('field_title', $_REQUEST['field_title']); + $obj->setVar('field_description', $_REQUEST['field_description']); + if ($obj->getVar('field_config')) { + $obj->setVar('field_type', $_REQUEST['field_type']); + if (isset($_REQUEST['field_valuetype'])) { + $obj->setVar('field_valuetype', $_REQUEST['field_valuetype']); + } + $options = $obj->getVar('field_options'); + + if (isset($_REQUEST['removeOptions']) && is_array($_REQUEST['removeOptions'])) { + foreach ($_REQUEST['removeOptions'] as $index) { + unset($options[$index]); + } + $redirect_to_edit = true; + } + + if (!empty($_REQUEST['addOption'])) { + foreach ($_REQUEST['addOption'] as $option) { + if (empty($option['value'])) continue; + $options[$option['key']] = $option['value']; + $redirect_to_edit = true; + } + } + $obj->setVar('field_options', $options); + } + if ($obj->getVar('field_edit')) { + $required = isset($_REQUEST['field_required']) ? $_REQUEST['field_required'] : 0; + $obj->setVar('field_required', $required); //0 = no, 1 = yes + if (isset($_REQUEST['field_maxlength'])) { + $obj->setVar('field_maxlength', $_REQUEST['field_maxlength']); + } + if (isset($_REQUEST['field_default'])) { + $field_default = $obj->getValueForSave($_REQUEST['field_default']); + //Check for multiple selections + if (is_array($field_default)) { + $obj->setVar('field_default', serialize($field_default)); + } else { + $obj->setVar('field_default', $field_default); + } + } + } + + if ($obj->getVar('field_show')) { + $obj->setVar('field_weight', $_REQUEST['field_weight']); + $obj->setVar('cat_id', $_REQUEST['field_category']); + } + if ( /*$obj->getVar('field_edit') && */isset($_REQUEST['step_id']) ) { + $obj->setVar('step_id', $_REQUEST['step_id']); + } + if ($profilefield_handler->insert($obj)) { + $groupperm_handler =& xoops_gethandler('groupperm'); + + $perm_arr = array(); + if ($obj->getVar('field_show')) { + $perm_arr[] = 'profile_show'; + $perm_arr[] = 'profile_visible'; + } + if ($obj->getVar('field_edit')) { + $perm_arr[] = 'profile_edit'; + } + if ($obj->getVar('field_edit') || $obj->getVar('field_show')) { + $perm_arr[] = 'profile_search'; + } + if (count($perm_arr) > 0) { + foreach ($perm_arr as $perm) { + $criteria = new CriteriaCompo(new Criteria('gperm_name', $perm)); + $criteria->add(new Criteria('gperm_itemid', intval($obj->getVar('field_id')))); + $criteria->add(new Criteria('gperm_modid', intval($GLOBALS['xoopsModule']->getVar('mid')))); + if (isset($_REQUEST[$perm]) && is_array($_REQUEST[$perm])) { + $perms = $groupperm_handler->getObjects($criteria); + if (count($perms) > 0) { + foreach (array_keys($perms) as $i) { + $groups[$perms[$i]->getVar('gperm_groupid')] =& $perms[$i]; + } + } else { + $groups = array(); + } + foreach ($_REQUEST[$perm] as $groupid) { + $groupid = intval($groupid); + if (!isset($groups[$groupid])) { + $perm_obj =& $groupperm_handler->create(); + $perm_obj->setVar('gperm_name', $perm); + $perm_obj->setVar('gperm_itemid', intval($obj->getVar('field_id'))); + $perm_obj->setVar('gperm_modid', $GLOBALS['xoopsModule']->getVar('mid')); + $perm_obj->setVar('gperm_groupid', $groupid); + $groupperm_handler->insert($perm_obj); + unset($perm_obj); + } + } + $removed_groups = array_diff(array_keys($groups), $_REQUEST[$perm]); + if (count($removed_groups) > 0) { + $criteria->add(new Criteria('gperm_groupid', "(" . implode(',', $removed_groups) . ")", "IN")); + $groupperm_handler->deleteAll($criteria); + } + unset($groups); + + } else { + $groupperm_handler->deleteAll($criteria); + } + unset($criteria); + } + } + $url = $redirect_to_edit ? 'field.php?op=edit&id=' . $obj->getVar('field_id') : 'field.php'; + redirect_header($url, 3, sprintf(_AM_PROFILE_SAVEDSUCCESS, _AM_PROFILE_FIELD)); + } + include_once '../include/forms.php'; + echo $obj->getHtmlErrors(); + $form = profile_getFieldForm($obj); + $form->display(); + break; + + case "delete": + $obj =& $profilefield_handler->get($_REQUEST['id']); + if (!$obj->getVar('field_config')) { + redirect_header('index.php', 2, _AM_PROFILE_FIELDNOTCONFIGURABLE); + } + if (isset($_REQUEST['ok']) && $_REQUEST['ok'] == 1) { + if (!$GLOBALS['xoopsSecurity']->check()) { + redirect_header('field.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors())); + } + if ($profilefield_handler->delete($obj)) { + redirect_header('field.php', 3, sprintf(_AM_PROFILE_DELETEDSUCCESS, _AM_PROFILE_FIELD)); + } else { + echo $obj->getHtmlErrors(); + } + } else { + xoops_confirm(array('ok' => 1,'id' => $_REQUEST['id'],'op' => 'delete'), $_SERVER['REQUEST_URI'], sprintf(_AM_PROFILE_RUSUREDEL, $obj->getVar('field_title'))); + } + break; + + case 'toggle': + if (isset($_REQUEST['field_id'])) { + $field_id = intval($_REQUEST['field_id']); + if (isset($_REQUEST['field_required'])) { + $field_required = intval($_REQUEST['field_required']); + profile_visible_toggle($field_id, $field_required); + } + } + break; +} + +if (isset($template_main)) { + $GLOBALS['xoopsTpl']->display("db:{$template_main}"); +} + +/** + * @param $field_id + * @param $field_required + */ +function profile_visible_toggle($field_id, $field_required) +{ + $field_required = ($field_required == 1) ? 0 : 1; + $this_handler =& xoops_getModuleHandler('field', 'profile'); + $obj = $this_handler->get($field_id); + $obj->setVar('field_required', $field_required); + if ($this_handler->insert($obj, true)) { + redirect_header('field.php', 1, _AM_PROFILE_REQUIRED_TOGGLE_SUCCESS); + } else { + redirect_header('field.php', 1, _AM_PROFILE_REQUIRED_TOGGLE_FAILED); + } +} + +include 'admin_footer.php'; Added: XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/admin/index.html =================================================================== --- XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/admin/index.html (rev 0) +++ XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/admin/index.html 2015-03-14 18:51:12 UTC (rev 13016) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Added: XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/admin/index.php =================================================================== --- XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/admin/index.php (rev 0) +++ XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/admin/index.php 2015-03-14 18:51:12 UTC (rev 13016) @@ -0,0 +1,42 @@ +<?php +/** + * Extended User Profile + * + * 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 profile + * @since 2.3.0 + * @author Jan Pedersen + * @author Taiwen Jiang <ph...@us...> + * @version $Id: index.php 13016 2015-03-15 18:21:22Z timgno $ + */ + +include_once 'admin_header.php'; +xoops_cp_header(); + +$indexAdmin = new ModuleAdmin(); +//----------------------- +// $xpPartnerHandler =& xoops_getmodulehandler('partners', $xoopsModule->getVar('dirname')); + +// $totalPartners = $xpPartnerHandler->getCount(); +// $totalNonActivePartners = $xpPartnerHandler->getCount(new Criteria('status', 0, '=')); +// $totalActivePartners = $totalPartners - $totalNonActivePartners; + +// $indexAdmin->addInfoBox(_MA_PROFILE_DASHBOARD); + +// $indexAdmin->addInfoBoxLine(_MA_PROFILE_DASHBOARD, "<infolabel>" ._MA_PROFILE_TOTALACTIVE. "</infolabel>", $totalActivePartners, 'Green'); +// $indexAdmin->addInfoBoxLine(_MA_PROFILE_DASHBOARD, "<infolabel>" ._MA_PROFILE_TOTALNONACTIVE. "</infolabel>", $totalNonActivePartners, 'Red'); +// $indexAdmin->addInfoBoxLine(_MA_PROFILE_DASHBOARD, "<infolabel>" ._MA_PROFILE_TOTALPARTNERS. "</infolabel><infotext>", $totalPartners."</infotext>"); +//---------------------------- + +echo $indexAdmin->addNavigation('index.php'); +echo $indexAdmin->renderIndex(); + +include 'admin_footer.php'; \ No newline at end of file Added: XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/admin/menu.php =================================================================== --- XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/admin/menu.php (rev 0) +++ XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/admin/menu.php 2015-03-14 18:51:12 UTC (rev 13016) @@ -0,0 +1,68 @@ +<?php +/** + * Extended User Profile + * + * 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 profile + * @since 2.3.0 + * @author Jan Pedersen + * @author Taiwen Jiang <ph...@us...> + * @version $Id: menu.php 12363 2014-03-08 10:39:06Z beckmi $ + */ + +defined("XOOPS_ROOT_PATH") or die("XOOPS root path not defined"); + +$path = dirname(dirname(dirname(dirname(__FILE__)))); +include_once $path . '/mainfile.php'; + +$dirname = basename(dirname(dirname(__FILE__))); +$module_handler = xoops_gethandler('module'); +$module = $module_handler->getByDirname($dirname); +$pathIcon32 = $module->getInfo('icons32'); +$pathModuleAdmin = $module->getInfo('dirmoduleadmin'); +$pathLanguage = $path . $pathModuleAdmin; + +if (!file_exists($fileinc = $pathLanguage . '/language/' . $GLOBALS['xoopsConfig']['language'] . '/' . 'main.php')) { + $fileinc = $pathLanguage . '/language/english/main.php'; +} + +include_once $fileinc; + +$adminmenu = array(); + +$i = 1; +$adminmenu[$i]['title'] = _MI_PROFILE_HOME; +$adminmenu[$i]['link'] = "admin/index.php"; +$adminmenu[$i]['icon'] = $pathIcon32.'/home.png' ; +$i++; +$adminmenu[$i]['title'] = _MI_PROFILE_USERS; +$adminmenu[$i]['link'] = "admin/user.php"; +$adminmenu[$i]['icon'] = $pathIcon32.'/users.png' ; +$i++; +$adminmenu[$i]['title'] = _MI_PROFILE_CATEGORIES; +$adminmenu[$i]['link'] = "admin/category.php"; +$adminmenu[$i]['icon'] = $pathIcon32.'/category.png' ; +$i++; +$adminmenu[$i]['title'] = _MI_PROFILE_FIELDS; +$adminmenu[$i]['link'] = "admin/field.php"; +$adminmenu[$i]['icon'] = $pathIcon32.'/index.png' ; +$i++; +$adminmenu[$i]['title'] = _MI_PROFILE_STEPS; +$adminmenu[$i]['link'] = "admin/step.php"; +$adminmenu[$i]['icon'] = $pathIcon32.'/stats.png' ; +$i++; +$adminmenu[$i]['title'] = _MI_PROFILE_PERMISSIONS; +$adminmenu[$i]['link'] = "admin/permissions.php"; +$adminmenu[$i]['icon'] = $pathIcon32.'/permissions.png' ; +$i++; +$adminmenu[$i]['title'] = _MI_PROFILE_ABOUT; +$adminmenu[$i]['link'] = 'admin/about.php'; +$adminmenu[$i]['icon'] = $pathIcon32.'/about.png'; Added: XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/admin/permissions.php =================================================================== --- XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/admin/permissions.php (rev 0) +++ XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/admin/permissions.php 2015-03-14 18:51:12 UTC (rev 13016) @@ -0,0 +1,109 @@ +<?php +/** + * Extended User Profile + * + * 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 profile + * @since 2.3.0 + * @author Jan Pedersen + * @author Taiwen Jiang <ph...@us...> + * @version $Id: permissions.php 13016 2015-03-15 18:21:22Z timgno $ + */ +include 'admin_header.php'; +xoops_cp_header(); +$indexAdmin = new ModuleAdmin(); +echo $indexAdmin->addNavigation('permissions.php'); + +$op = isset($_REQUEST['op']) ? $_REQUEST['op'] : "edit"; + +$perm_desc = ""; +switch ($op) { +case "visibility": + //redirect_header("visibility.php", 0, _AM_PROFILE_PROF_VISIBLE); + header("Location: visibility.php"); + break; + +case "edit": + $title_of_form = _AM_PROFILE_PROF_EDITABLE; + $perm_name = "profile_edit"; + $restriction = "field_edit"; + $anonymous = false; + break; + +case "search": + $title_of_form = _AM_PROFILE_PROF_SEARCH; + $perm_name = "profile_search"; + $restriction = ""; + $anonymous = true; + break; + +case "access": + $title_of_form = _AM_PROFILE_PROF_ACCESS; + $perm_name = "profile_access"; + $perm_desc = _AM_PROFILE_PROF_ACCESS_DESC; + $restriction = ""; + $anonymous = true; + break; +} + +include_once $GLOBALS['xoops']->path( "/class/xoopsformloader.php" ); +$opform = new XoopsSimpleForm('', 'opform', 'permissions.php', "get"); +$op_select = new XoopsFormSelect("", 'op', $op); +$op_select->setExtra('onchange="document.forms.opform.submit()"'); +$op_select->addOption('visibility', _AM_PROFILE_PROF_VISIBLE); +$op_select->addOption('edit', _AM_PROFILE_PROF_EDITABLE); +$op_select->addOption('search', _AM_PROFILE_PROF_SEARCH); +$op_select->addOption('access', _AM_PROFILE_PROF_ACCESS); +$opform->addElement($op_select); +$opform->display(); + +$module_id = $GLOBALS['xoopsModule']->getVar('mid'); +include_once $GLOBALS['xoops']->path( '/class/xoopsform/grouppermform.php' ); +$form = new XoopsGroupPermForm($title_of_form, $module_id, $perm_name, $perm_desc, 'admin/permissions.php', $anonymous); + +if ($op == "access") { + $member_handler =& xoops_gethandler('member'); + $glist = $member_handler->getGroupList(); + foreach (array_keys($glist) as $i ) { + if ($i != XOOPS_GROUP_ANONYMOUS) { + $form->addItem($i, $glist[$i]); + } + } + +} else { + $profile_handler =& xoops_getmodulehandler('profile'); + $fields = $profile_handler->loadFields(); + + if ($op != "search") { + foreach (array_keys($fields) as $i ) { + if ( $restriction == "" || $fields[$i]->getVar($restriction) ) { + $form->addItem($fields[$i]->getVar('field_id'), xoops_substr($fields[$i]->getVar('field_title'), 0, 25) ); + } + } + } else { + $searchable_types = array('textbox', + 'select', + 'radio', + 'yesno', + 'date', + 'datetime', + 'timezone', + 'language'); + foreach (array_keys($fields) as $i ) { + if ( in_array($fields[$i]->getVar('field_type'), $searchable_types) ) { + $form->addItem($fields[$i]->getVar('field_id'), xoops_substr($fields[$i]->getVar('field_title'), 0, 25) ); + } + } + } +} +$form->display(); +include 'admin_footer.php'; +//xoops_cp_footer(); Added: XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/admin/step.php =================================================================== --- XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/admin/step.php (rev 0) +++ XoopsCore/branches/2.5.x/2.5.8_timgno/htdocs/modules/profile/admin/step.php 2015-03-14 18:51:12 UTC (rev 13016) @@ -0,0 +1,114 @@ +<?php +/** + * Extended User Profile + * + * 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 profile + * @since 2.3.0 + * @author Jan Pedersen + * @author Taiwen Jiang <ph...@us...> + * @version $Id: step.php 12360 2014-03-08 09:46:59Z beckmi $ + */ +include 'admin_header.php'; +xoops_cp_header(); +$indexAdmin = new ModuleAdmin(); + +$indexAdmin->addItemButton(_ADD . ' ' . _AM_PROFILE_... [truncated message content] |