1
kerkyra
SEO - Change meta data in register and login pages
  • 2008/10/2 10:12

  • kerkyra

  • Just can't stay away

  • Posts: 553

  • Since: 2005/2/14


Hallo there,

i noticed that google gives some warnings of duplicate meta content in register.php and user.php files so i added the following lines to change the title-description-keywords on those pages meta data!

register.php at the end of the file line 281 add
Quote:

$xoopsTpl->assign('xoops_pagetitle', _US_USERREG);

if (is_object($xoTheme)) {
$xoTheme->addMeta( 'meta', 'keywords',_US_NICKNAME.","._US_PASSWORD.","._US_WEBSITE);
$xoTheme->addMeta( 'meta', 'description',strip_tags($xoopsConfigUser['reg_disclaimer']) );

} else {
$xoopsTpl->assign('xoops_meta_keywords','keywords',_US_NICKNAME.","._US_PASSWORD.","._US_WEBSITE);
$xoopsTpl->assign('xoops_meta_description', strip_tags($xoopsConfigUser['reg_disclaimer']));
}


user.php line 71 add
Quote:

$xoopsTpl->assign('xoops_pagetitle', _LOGIN);

if (is_object($xoTheme)) {
$xoTheme->addMeta( 'meta', 'keywords',_USERNAME.","._US_PASSWORD.","._US_LOSTPASSWORD);
$xoTheme->addMeta( 'meta', 'description',_US_LOSTPASSWORD." "._US_NOPROBLEM );

} else {
$xoopsTpl->assign('xoops_meta_keywords','keywords',_USERNAME.","._US_PASSWORD.","._US_LOSTPASSWORD);
$xoopsTpl->assign('xoops_meta_description', _US_LOSTPASSWORD." "._US_NOPROBLEM);
}


thats it. I think this should be taken into account in future versions as well as by module developers to make XOOPS a lil more SEO friendly. It's very simple to implement and really worth the time to do it i think.
whttp://www.guidemap.gr - Beta is out...

2
dslchart
Re: SEO - Change meta data in register and login pages
  • 2008/10/2 11:34

  • dslchart

  • Not too shy to talk

  • Posts: 112

  • Since: 2008/9/7 1


thank you for sharing. your seo tip is very useful.

3
serial-weber
Re: SEO - Change meta data in register and login pages

Hi kerkyra,

You say to add a code at the end of the file register.php line 281, I am using XOOPS 2.0.18 and my file register.php has only 271 lines!!! Is your hack only used with 2.3?

4
kerkyra
Re: SEO - Change meta data in register and login pages
  • 2008/10/6 8:42

  • kerkyra

  • Just can't stay away

  • Posts: 553

  • Since: 2005/2/14


hey mate you can just add it above the include header line i think! If you quote the code i could show you.cheers
whttp://www.guidemap.gr - Beta is out...

5
Marco
Re: SEO - Change meta data in register and login pages
  • 2008/10/9 4:07

  • Marco

  • Home away from home

  • Posts: 1256

  • Since: 2004/3/15


added to SF bugtracker
thanks
Do synergy or die.

6
JulioNC
Re: SEO - Change meta data in register and login pages
  • 2008/10/28 3:12

  • JulioNC

  • Quite a regular

  • Posts: 239

  • Since: 2004/10/8


Fixed in SVN:
http://xoops.svn.sf.net/viewvc/xoops?view=rev&revision=2299

I changed some files, but we can do better.
Can you agreed to give me advice on how I could improve the SEO for XOOPS ?

7
kerkyra
Re: SEO - Change meta data in register and login pages
  • 2008/10/28 12:04

  • kerkyra

  • Just can't stay away

  • Posts: 553

  • Since: 2005/2/14


what do you mean mate?:/
whttp://www.guidemap.gr - Beta is out...

8
JulioNC
Re: SEO - Change meta data in register and login pages
  • 2008/11/2 5:21

  • JulioNC

  • Quite a regular

  • Posts: 239

  • Since: 2004/10/8


My sincere apologies for the delay..
I said:
Could you give me advice/reference for SEO ? (for XOOPS, of course)

9
kerkyra
Re: SEO - Change meta data in register and login pages
  • 2008/11/2 15:05

  • kerkyra

  • Just can't stay away

  • Posts: 553

  • Since: 2005/2/14


the least you could do to make your pages seo friendly is give them a unique page title, page keywords according to the content and of course page description (for every content page-even on printable pages you can add those words 'printable version' or something). That's what the code above is doing and you can add it on every php file visible by search engine bots.
whttp://www.guidemap.gr - Beta is out...

10
Ganga
Re: SEO - Change meta data in register and login pages
  • 2008/11/11 9:23

  • Ganga

  • Just popping in

  • Posts: 24

  • Since: 2007/10/22


code of, 2.0.18.2 register.php 271 line?


// $Id: register.php 1029 2007-09-09 03:49:25Z phppp $
//  ------------------------------------------------------------------------ //
//                XOOPS - PHP Content Management System                      //
//                    Copyright (c) 2000 XOOPS.org                           //
//                                                    //
//  ------------------------------------------------------------------------ //
//  This program is free software; you can redistribute it and/or modify     //
//  it under the terms of the GNU General Public License as published by     //
//  the Free Software Foundation; either version 2 of the License, or        //
//  (at your option) any later version.                                      //
//                                                                           //
//  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            //
//  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 //
//  ------------------------------------------------------------------------ //

$xoopsOption['pagetype'] = 'user';

include 
'mainfile.php';
$myts =& MyTextSanitizer::getInstance();

$config_handler =& xoops_gethandler('config');
$xoopsConfigUser =& $config_handler->getConfigsByCat(XOOPS_CONF_USER);

if (empty(
$xoopsConfigUser['allow_register'])) {
    
redirect_header('index.php'6_US_NOREGISTER);
    exit();
}

function 
userCheck($uname$email$pass$vpass)
{
    global 
$xoopsConfigUser;
    
$xoopsDB =& Database::getInstance();
    
$myts =& MyTextSanitizer::getInstance();
    
$stop '';
    if (!
checkEmail($email)) {
        
$stop .= _US_INVALIDMAIL.'';
    }
    foreach (
$xoopsConfigUser['bad_emails'] as $be) {
        if (!empty(
$be) && preg_match("/".$be."/i"$email)) {
            
$stop .= _US_INVALIDMAIL.'';
            break;
        }
    }
    if (
strrpos($email,' ') > 0) {
        
$stop .= _US_EMAILNOSPACES.'';
    }
    
$uname xoops_trim($uname);
    switch (
$xoopsConfigUser['uname_test_level']) {
    case 
0:
        
// strict
        
$restriction '/[^a-zA-Z0-9_-]/';
        break;
    case 
1:
        
// medium
        
$restriction '/[^a-zA-Z0-9_-<>,.$%#@!\'"]/';
        break;
    case 2:
        // loose
        
$restriction = '/[00-40]/';
        break;
    }
    if (empty(
$uname) || preg_match($restriction$uname)) {
        
$stop .= _US_INVALIDNICKNAME."<br />";
    }
    if (strlen(
$uname) > $xoopsConfigUser['maxuname']) {
        
$stop .= sprintf(_US_NICKNAMETOOLONG, $xoopsConfigUser['maxuname'])."<br />";
    }
    if (strlen(
$uname) < $xoopsConfigUser['minuname']) {
        
$stop .= sprintf(_US_NICKNAMETOOSHORT, $xoopsConfigUser['minuname'])."<br />";
    }
    foreach (
$xoopsConfigUser['bad_unames'] as $bu) {
        if (!empty(
$bu) && preg_match("/".$bu."/i", $uname)) {
            
$stop .= _US_NAMERESERVED."<br />";
            break;
        }
    }
    if (strrpos(
$uname, ' ') > 0) {
        
$stop .= _US_NICKNAMENOSPACES."<br />";
    }
    
$sql = sprintf('SELECT COUNT(*) FROM %s WHERE uname = %s', $xoopsDB->prefix('users'), $xoopsDB->quoteString(addslashes($uname)));
    
$result = $xoopsDB->query($sql);
    list(
$count) = $xoopsDB->fetchRow($result);
    if (
$count > 0) {
        
$stop .= _US_NICKNAMETAKEN."<br />";
    }
    
$count = 0;
    if ( 
$email ) {
        
$sql = sprintf('SELECT COUNT(*) FROM %s WHERE email = %s', $xoopsDB->prefix('users'), $xoopsDB->quoteString(addslashes($email)));
        
$result = $xoopsDB->query($sql);
        list(
$count) = $xoopsDB->fetchRow($result);
        if ( 
$count > 0 ) {
            
$stop .= _US_EMAILTAKEN."<br />";
        }
    }
    if ( !isset(
$pass) || $pass == '' || !isset($vpass) || $vpass == '' ) {
        
$stop .= _US_ENTERPWD.'';
    }
    if ( (isset(
$pass)) && ($pass != $vpass) ) {
        
$stop .= _US_PASSNOTSAME.'';
    } elseif ( (
$pass != '') && (strlen($pass) < $xoopsConfigUser['minpass']) ) {
        
$stop .= sprintf(_US_PWDTOOSHORT,$xoopsConfigUser['minpass'])."<br />";
    }
    return 
$stop;
}
$op = !isset($_POST['op']) ? 'register' : $_POST['op'];
$uname = isset($_POST['uname']) ? $myts->stripSlashesGPC($_POST['uname']) : '';
$email = isset($_POST['email']) ? trim($myts->stripSlashesGPC($_POST['email'])) : '';
$url = isset($_POST['url']) ? trim($myts->stripSlashesGPC($_POST['url'])) : '';
$pass = isset($_POST['pass']) ? $myts->stripSlashesGPC($_POST['pass']) : '';
$vpass = isset($_POST['vpass']) ? $myts->stripSlashesGPC($_POST['vpass']) : '';
$timezone_offset = isset($_POST['timezone_offset']) ? intval($_POST['timezone_offset']) : $xoopsConfig['default_TZ'];
$user_viewemail = (isset($_POST['user_viewemail']) && intval($_POST['user_viewemail'])) ? 1 : 0;
$user_mailok = (isset($_POST['user_mailok']) && intval($_POST['user_mailok'])) ? 1 : 0;
$agree_disc = (isset($_POST['agree_disc']) && intval($_POST['agree_disc'])) ? 1 : 0;
switch ( 
$op ) {
case 'newuser':
    include 'header.php';
    
$stop = '';
    if (!
$GLOBALS['xoopsSecurity']->check()) {
        
$stop .= implode('', $GLOBALS['xoopsSecurity']->getErrors())."<br />";
    }
    if (
$xoopsConfigUser['reg_dispdsclmr'] != 0 && $xoopsConfigUser['reg_disclaimer'] != '') {
        if (empty(
$agree_disc)) {
            
$stop .= _US_UNEEDAGREE.'';
        }
    }
    
$stop .= userCheck($uname$email$pass$vpass);
    if (empty(
$stop)) {
        echo _US_USERNAME."
".$myts->htmlSpecialChars($uname)."<br />";
        echo _US_EMAIL."
".$myts->htmlSpecialChars($email)."<br />";
        if (
$url != '') {
            
$url = formatURL($url);
            echo _US_WEBSITE.': '.
$myts->htmlSpecialChars($url).'';
        }
        
$f_timezone = ($timezone_offset < 0) ? 'GMT '.$timezone_offset : 'GMT +'.$timezone_offset;
        echo _US_TIMEZONE."
$f_timezone<br />";
        echo "
<form action='register.php' method='post'>
        <
input type='hidden' name='uname' value='".$myts->htmlSpecialChars($uname)."' />
        <
input type='hidden' name='email' value='".$myts->htmlSpecialChars($email)."' />";
        echo "
<input type='hidden' name='user_viewemail' value='".$user_viewemail."' />
        <
input type='hidden' name='timezone_offset' value='".(float)$timezone_offset."' />
        <
input type='hidden' name='url' value='".$myts->htmlSpecialChars($url)."' />
        <
input type='hidden' name='pass' value='".$myts->htmlSpecialChars($pass)."' />
        <
input type='hidden' name='vpass' value='".$myts->htmlSpecialChars($vpass)."' />
        <
input type='hidden' name='user_mailok' value='".$user_mailok."' />
        <
br /><br /><input type='hidden' name='op' value='finish' />".$GLOBALS['xoopsSecurity']->getTokenHTML()."<input type='submit' value='". _US_FINISH ."' />form>";
    } else {
        echo "
<span style='color:#ff0000;'>$stopspan>";
        include 'include/registerform.php';
        
$reg_form->display();
    }
    include 'footer.php';
    break;
case 'finish':
    include 'header.php';
    
$stop = userCheck($uname$email$pass$vpass);
    if (!
$GLOBALS['xoopsSecurity']->check()) {
        
$stop .= implode('', $GLOBALS['xoopsSecurity']->getErrors())."<br />";
    }
    if ( empty(
$stop) ) {
        
$member_handler =& xoops_gethandler('member');
        
$newuser =& $member_handler->createUser();
        
$newuser->setVar('user_viewemail',$user_viewemail, true);
        
$newuser->setVar('uname', $uname, true);
        
$newuser->setVar('email', $email, true);
        if (
$url != '') {
            
$newuser->setVar('url', formatURL($url), true);
        }
        
$newuser->setVar('user_avatar','blank.gif', true);
        
$actkey = substr(md5(uniqid(mt_rand(), 1)), 0, 8);
        
$newuser->setVar('actkey', $actkey, true);
        
$newuser->setVar('pass', md5($pass), true);
        
$newuser->setVar('timezone_offset', $timezone_offset, true);
        
$newuser->setVar('user_regdate', time(), true);
        
$newuser->setVar('uorder',$xoopsConfig['com_order'], true);
        
$newuser->setVar('umode',$xoopsConfig['com_mode'], true);
        
$newuser->setVar('user_mailok',$user_mailok, true);
        if (
$xoopsConfigUser['activation_type'] == 1) {
            
$newuser->setVar('level', 1, true);
        }
        if (!
$member_handler->insertUser($newuser)) {
            echo _US_REGISTERNG;
            include 'footer.php';
            exit();
        }
        
$newid = $newuser->getVar('uid');
        if (!
$member_handler->addUserToGroup(XOOPS_GROUP_USERS, $newid)) {
            echo _US_REGISTERNG;
            include 'footer.php';
            exit();
        }
        if (
$xoopsConfigUser['activation_type'] == 1) {
            redirect_header('index.php', 4, _US_ACTLOGIN);
            exit();
        }
        if (
$xoopsConfigUser['activation_type'] == 0) {
            
$xoopsMailer =& getMailer();
            
$xoopsMailer->useMail();
            
$xoopsMailer->setTemplate('register.tpl');
            
$xoopsMailer->assign('SITENAME', $xoopsConfig['sitename']);
            
$xoopsMailer->assign('ADMINMAIL', $xoopsConfig['adminmail']);
            
$xoopsMailer->assign('SITEURL', XOOPS_URL."/");
            
$xoopsMailer->setToUsers(new XoopsUser($newid));
            
$xoopsMailer->setFromEmail($xoopsConfig['adminmail']);
            
$xoopsMailer->setFromName($xoopsConfig['sitename']);
            
$xoopsMailer->setSubject(sprintf(_US_USERKEYFOR, $uname));
            if ( !
$xoopsMailer->send() ) {
                echo _US_YOURREGMAILNG;
            } else {
                echo _US_YOURREGISTERED;
            }
        } elseif (
$xoopsConfigUser['activation_type'] == 2) {
            
$xoopsMailer =& getMailer();
            
$xoopsMailer->useMail();
            
$xoopsMailer->setTemplate('adminactivate.tpl');
            
$xoopsMailer->assign('USERNAME', $uname);
            
$xoopsMailer->assign('USEREMAIL', $email);
            
$xoopsMailer->assign('USERACTLINK', XOOPS_URL.'/user.php?op=actv&id='.$newid.'&actkey='.$actkey);
            
$xoopsMailer->assign('SITENAME', $xoopsConfig['sitename']);
            
$xoopsMailer->assign('ADMINMAIL', $xoopsConfig['adminmail']);
            
$xoopsMailer->assign('SITEURL', XOOPS_URL."/");
            
$member_handler =& xoops_gethandler('member');
            
$xoopsMailer->setToGroups($member_handler->getGroup($xoopsConfigUser['activation_group']));
            
$xoopsMailer->setFromEmail($xoopsConfig['adminmail']);
            
$xoopsMailer->setFromName($xoopsConfig['sitename']);
            
$xoopsMailer->setSubject(sprintf(_US_USERKEYFOR, $uname));
            if ( !
$xoopsMailer->send() ) {
                echo _US_YOURREGMAILNG;
            } else {
                echo _US_YOURREGISTERED2;
            }
        }
        if (
$xoopsConfigUser['new_user_notify'] == 1 && !empty($xoopsConfigUser['new_user_notify_group'])) {
            
$xoopsMailer =& getMailer();
            
$xoopsMailer->useMail();
            
$member_handler =& xoops_gethandler('member');
            
$xoopsMailer->setToGroups($member_handler->getGroup($xoopsConfigUser['new_user_notify_group']));
            
$xoopsMailer->setFromEmail($xoopsConfig['adminmail']);
            
$xoopsMailer->setFromName($xoopsConfig['sitename']);
            
$xoopsMailer->setSubject(sprintf(_US_NEWUSERREGAT,$xoopsConfig['sitename']));
            
$xoopsMailer->setBody(sprintf(_US_HASJUSTREG, $uname));
            
$xoopsMailer->send();
        }
    } else {
        echo "
<span style='color:#ff0000; font-weight:bold;'>$stopspan>";
        include 'include/registerform.php';
        
$reg_form->display();
    }
    include 'footer.php';
    break;
case 'register':
default:
    include 'header.php';
    include 'include/registerform.php';
    
$reg_form->display();
    include 'footer.php';
    break;
}
?>


und of user.php 181 line
// $Id: user.php 1282 2008-01-29 04:26:44Z phppp $
//  ------------------------------------------------------------------------ //
//                XOOPS - PHP Content Management System                      //
//                    Copyright (c) 2000 XOOPS.org                           //
//                                                    //
//  ------------------------------------------------------------------------ //
//  This program is free software; you can redistribute it and/or modify     //
//  it under the terms of the GNU General Public License as published by     //
//  the Free Software Foundation; either version 2 of the License, or        //
//  (at your option) any later version.                                      //
//                                                                           //
//  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            //
//  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 //
//  ------------------------------------------------------------------------ //

$xoopsOption['pagetype'] = 'user';
include 
'mainfile.php';

$op 'main';

if ( isset(
$_POST['op']) ) {
    
$op trim($_POST['op']);
} elseif ( isset(
$_GET['op']) ) {
    
$op trim($_GET['op']);
}

if (
$op == 'main') {
    if ( !
$xoopsUser ) {
        
$xoopsOption['template_main'] = 'system_userform.html';
        include 
'header.php';
        
$xoopsTpl->assign('lang_login'_LOGIN);
        
$xoopsTpl->assign('lang_username'_USERNAME);
        if (isset(
$_COOKIE[$xoopsConfig['usercookie']])) {
            
$xoopsTpl->assign('usercookie'$_COOKIE[$xoopsConfig['usercookie']]);
        }
        if (isset(
$_GET['xoops_redirect'])) {
            
$xoopsTpl->assign('redirect_page'htmlspecialchars(trim($_GET['xoops_redirect']), ENT_QUOTES));
        }
        
$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 
'footer.php';
        exit();
    }
    if ( !empty(
$_GET['xoops_redirect']) ) {
        
$redirect trim($_GET['xoops_redirect']);
        
$isExternal false;
        if (
$pos strpos$redirect'://' )) {
            
$xoopsLocation substrXOOPS_URLstrposXOOPS_URL'://' ) + );
            if ( 
strcasecmp(substr($redirect$pos 3strlen($xoopsLocation)), $xoopsLocation) ) {
                
$isExternal true;
            }
        }
        if (!
$isExternal) {
            
header('Location: ' $redirect);
            exit();
        }
    }
    
header('Location: '.XOOPS_URL.'/userinfo.php?uid='.$xoopsUser->getVar('uid'));
    exit();
}

if (
$op == 'login') {
    include_once 
XOOPS_ROOT_PATH.'/include/checklogin.php';
    exit();
}

if (
$op == 'logout') {
    
$message '';
    
$_SESSION = array();
    
session_destroy();
    
// clear entry from online users table
    
if (is_object($xoopsUser)) {
        
$online_handler =& xoops_gethandler('online');
        
$online_handler->destroy($xoopsUser->getVar('uid'));
    }
    
$message _US_LOGGEDOUT.''._US_THANKYOUFORVISIT;
    
redirect_header('index.php'1$message);
    exit();
}

if (
$op == 'actv') {
    
$id intval($_GET['id']);
    
$actkey trim($_GET['actkey']);
    if (empty(
$id)) {
        
redirect_header('index.php',1,'');
        exit();
    }
    
$member_handler =& xoops_gethandler('member');
    
$thisuser =& $member_handler->getUser($id);
    if (!
is_object($thisuser)) {
        exit();
    }
    if (
$thisuser->getVar('actkey') != $actkey) {
        
redirect_header('index.php',5,_US_ACTKEYNOT);
    } else {
        if (
$thisuser->getVar('level') > ) {
            
redirect_header'user.php'5_US_ACONTACTfalse );
        } else {
            if (
false != $member_handler->activateUser($thisuser)) {
                
$config_handler =& xoops_gethandler('config');
                
$xoopsConfigUser =& $config_handler->getConfigsByCat(XOOPS_CONF_USER);
                if (
$xoopsConfigUser['activation_type'] == 2) {
                    
$myts =& MyTextSanitizer::getInstance();
                    
$xoopsMailer =& getMailer();
                    
$xoopsMailer->useMail();
                    
$xoopsMailer->setTemplate('activated.tpl');
                    
$xoopsMailer->assign('SITENAME'$xoopsConfig['sitename']);
                    
$xoopsMailer->assign('ADMINMAIL'$xoopsConfig['adminmail']);
                    
$xoopsMailer->assign('SITEURL'XOOPS_URL."/");
                    
$xoopsMailer->setToUsers($thisuser);
                    
$xoopsMailer->setFromEmail($xoopsConfig['adminmail']);
                    
$xoopsMailer->setFromName($xoopsConfig['sitename']);
                    
$xoopsMailer->setSubject(sprintf(_US_YOURACCOUNT,$xoopsConfig['sitename']));
                    include 
'header.php';
                    if ( !
$xoopsMailer->send() ) {
                        
printf(_US_ACTVMAILNG$thisuser->getVar('uname'));
                    } else {
                        
printf(_US_ACTVMAILOK$thisuser->getVar('uname'));
                    }
                    include 
'footer.php';
                } else {
                    
redirect_header'user.php'5_US_ACTLOGINfalse );
                }
            } else {
                
redirect_header('index.php',5,'Activation failed!');
            }
        }
    }
    exit();
}

if (
$op == 'delete') {
    
$config_handler =& xoops_gethandler('config');
    
$xoopsConfigUser =& $config_handler->getConfigsByCat(XOOPS_CONF_USER);
    if (!
$xoopsUser || $xoopsConfigUser['self_delete'] != 1) {
        
redirect_header('index.php',5,_US_NOPERMISS);
        exit();
    } else {
        
$groups $xoopsUser->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']) ? intval($_POST['ok']);
        if (
$ok != 1) {
            include 
'header.php';
            
xoops_confirm(array('op' => 'delete''ok' => 1), 'user.php'_US_SURETODEL.'
'
._US_REMOVEINFO);
            include 
'footer.php';
        } else {
            
$del_uid $xoopsUser->getVar("uid");
            
$member_handler =& xoops_gethandler('member');
            if (
false != $member_handler->deleteUser($xoopsUser)) {
                
$online_handler =& xoops_gethandler('online');
                
$online_handler->destroy($del_uid);
                
xoops_notification_deletebyuser($del_uid);
                
redirect_header('index.php'5_US_BEENDELED);
            }
            
redirect_header('index.php',5,_US_NOPERMISS);
        }
        exit();
    }
}
?>


Login

Who's Online

158 user(s) are online (116 user(s) are browsing Support Forums)


Members: 0


Guests: 158


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Dec 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits