1
Ganga
Re: Xoops Adria
  • 2010/7/12 10:50

  • Ganga

  • Just popping in

  • Posts: 24

  • Since: 2007/10/22


I imali sta od ovoga evo i ja sam tu, a znam da i saba;) ce pripomoc....



2
Ganga
Re: Banners
  • 2009/11/27 11:31

  • Ganga

  • Just popping in

  • Posts: 24

  • Since: 2007/10/22


Quote:
by ghia Best code would be


[size=xx-large]"[/size]

Why?
Without this at the beginning and end of the banner does not work with us...



3
Ganga
Re: Banners
  • 2009/11/26 18:09

  • Ganga

  • Just popping in

  • Posts: 24

  • Since: 2007/10/22


I found a mistake in any language is a mistake and in xoops_root \ language \ Croatian \ banners.php and xoops_root \ language \ english \ banners.php line 52 + 53 english: Change OLD:
define('_BANNERS_SEND_STATS''Send <a href='%s' title='E-mail Stats'/>E-mail Stats</a> for this Banner');
define('_BANNERS_POINTS','This Banner points to <a href='%s' title=''>this URL</a>');
TO NEW:
define('_BANNERS_SEND_STATS',"Send <a href='%s' title='E-mail Stats'/>E-mail Stats</a> for this Banner");
define('_BANNERS_POINTS',"This Banner points to <a href='%s' title=''>this URL</a>");
croatian:http://xoopshr.org/modules/newbb/viewtopic.php?topic_id=154&post_id=876#forumpost876 A big thank you feichtl with myxoops German



4
Ganga
Re: Banners
  • 2009/11/26 12:04

  • Ganga

  • Just popping in

  • Posts: 24

  • Since: 2007/10/22


This problem is in the language(Croatian), yet I have not found where ...
if you switch the language to English it works banners.


I also had this error. But if you turn on the DEBUG, you can see it immediately!

ajgour:
Probaj molimte prebacit na engleski pami reci dali onda ide reklamna poruka...Pozdrav



5
Ganga
Re: upgrade problem with Croatian characters
  • 2009/11/24 21:48

  • Ganga

  • Just popping in

  • Posts: 24

  • Since: 2007/10/22


Quote:
by ghia That is what I tought. And how did you make the conversion?
with this convert.php
<?php

// convert tvoj xoops

ini_set ('max_execution_time''6000');
include_once 
'mainfile.php';
// ??????????? ??????
if( ! empty( $_POST['convert'] ) ) {

    include 
XOOPS_ROOT_PATH.'/header.php';
    
    
$old_prefix XOOPS_DB_PREFIX;

    
$srs $xoopsDB->queryF'SHOW TABLE STATUS FROM `'.XOOPS_DB_NAME.'`' ) ;

    if( ! 
$xoopsDB->getRowsNum$srs ) ) die( "You are not allowed to copy tables" ) ;

    
$count 0;
    while( 
$row_table $xoopsDB->fetchArray$srs ) ) {
        
$count ++ ;
        
$old_table $row_table['Name'] ;
        
// ???? ?????? ??????? ?? ???????? ???????? ??????, ?? ??????????...
        
if( substr$old_table strlen$old_prefix ) + ) !== $old_prefix '_' ) continue ;
        
        
// ???????????? ??????? ? utf8
        
$sql 'ALTER TABLE `'.$old_table.'` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci';
        if(
$xoopsDB->queryF($sql)) {
            echo 
'ok - '.$sql.'<br />';
        } else {
            echo 
$xoopsDB->error().' - '.$sql.'<br />';
        }
        
// ????????????? ????????? ????????????? ??????
        
$sql 'ALTER TABLE `'.$old_table.'` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci';
        if(
$xoopsDB->queryF($sql)) {
            echo 
'ok - '.$sql.'<br />';
        } else {
            echo 
$xoopsDB->error().' - '.$sql.'<br />';
        }

    }
    
    
// ????????????? ????????? ???? ??????
    
$sql 'ALTER DATABASE `'.XOOPS_DB_NAME.'` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci';
    if(
$xoopsDB->queryF($sql)) {
        echo 
'ok - '.$sql.'<br />';
    } else {
        echo 
$xoopsDB->error().' - '.$sql.'<br />';
    }
    include 
XOOPS_ROOT_PATH.'/footer.php';

// ????? ?????
} else {
    include 
XOOPS_ROOT_PATH.'/header.php';
    
xoops_confirm(array('convert' => 1), 'convert.php''Convert in utf8?');
    include 
XOOPS_ROOT_PATH.'/footer.php';
}



?>



6
Ganga
Re: upgrade problem with Croatian characters
  • 2009/11/24 19:15

  • Ganga

  • Just popping in

  • Posts: 24

  • Since: 2007/10/22


Quote:
Was your database from the beginning always in UTF-8?


was in latin1
--------

bjuti koja je kod tebe prije verzija xoopsa bila(pre 2.4) 2.33?



7
Ganga
Re: upgrade problem with Croatian characters
  • 2009/11/24 15:48

  • Ganga

  • Just popping in

  • Posts: 24

  • Since: 2007/10/22


Quote:
Your database seems to be latin1. The collation is not reported.
Change mainfile.php and global.php to use latin1 and ISO-....
You need also ansi language files for your core and modules.

Conversion of your database to UTF-8 is also possible, but not easy or strait forward. You could attempt by converting the format of your backup SQL file from ansi to UTF-8 without BOM by Notepad++. (Also changing character sets and collation directives in this file)


Thanks for your reply

My complete database is already in utf8_general_ci

Resized Image


and if I open the edditor is already UTF-8 without BOM...

Quote:
by deka87
there is a great tool for XOOPS upgrade encoding conversion on xoops2.ru by andrey3761. some well scripts that will do the work for you plus the manual. it's being tested now. once it's prepared, it should be up at xoops.org.

I already tried all the functions




8
Ganga
upgrade problem with Croatian characters
  • 2009/11/24 10:58

  • Ganga

  • Just popping in

  • Posts: 24

  • Since: 2007/10/22


Hello Everyone,
I made upgrade from 2.18.2 to 2.4.1 and it worked all ...
Croatian XOOPS 2.4.1 UTF-8
Croatian language modules, all UTF-8
Page works great Croatian characters (??žš?) are there.
Now I have but the problem is that in the forum / NewBB and converts it into news with the Croatian characters in? um. (only in old posts on nine everything is ok)

In the database are properly displayed:
-- phpMyAdmin SQL Dump
-- version 2.11.8.1deb1
-- http://www.phpmyadmin.net
-- 
-- 
Hostlocalhost
-- Erstellungszeit24. November 2009 um 10:55
-- Server Version5.0.67
-- PHP-Version5.2.6-2ubuntu4.2

SET FOREIGN_KEY_CHECKS
=0;

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

SET AUTOCOMMIT=0;
START TRANSACTION;


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

-- 
-- 
Datenbank: `h24`
-- 

-- --------------------------------------------------------

-- 
-- 
Tabellenstruktur für Tabelle `xoops_bb_categories`
-- 
-- 
Erzeugt am22. November 2009 um 18:46
-- Aktualisiert am22. November 2009 um 18:46
-- Letzter Check am22. November 2009 um 18:46
-- 

DROP TABLE IF EXISTS `xoops_bb_categories`;
CREATE TABLE IF NOT EXISTS `xoops_bb_categories` (
  `
cat_idsmallint(3unsigned NOT NULL auto_increment,
  `
cat_imagevarchar(50) default NULL,
  `
cat_titlevarchar(100NOT NULL default '',
  `
cat_descriptiontext NOT NULL,
  `
cat_ordersmallint(3unsigned NOT NULL default '0',
  
PRIMARY KEY  (`cat_id`),
  
KEY `cat_order` (`cat_order`)
ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=12 ;

-- 
-- 
Daten für Tabelle `xoops_bb_categories`
-- 

INSERT INTO `xoops_bb_categories` (`cat_id`, `cat_image`, `cat_title`, `cat_description`, `cat_order`) VALUES
(1NULL'Bosna i Hercegovina Regionalno(Županijski)'''0),
(
2NULL'Društvo Kultura i Zabava'''4),
(
3NULL'Hrvatska Regionalno'''5),
(
4NULL'Ljubav,sex,erotika  na hercegova?ki na?in'''3),
(
5NULL'Sport'''7),
(
6NULL'Ra?unala, Internet i Mobitel(export-import)'''8),
(
7NULL'Hercegovina24.de/Hercegovina24.com'''9),
(
8NULL'Politika i Povjest'''1),
(
9NULL'Dijaspora Regionalno'''6),
(
10NULL'Free Zone'''2),
(
11NULL'Muški-Ženski kutak'''2);

SET FOREIGN_KEY_CHECKS=1;

COMMIT;


but if I play backup to new XOOPS because looks like this:

Resized Image

I charged everything but I have not found help ...

who can help please

p.s.sorry for my english:(



9
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?


<?php
// $Id: register.php 1029 2007-09-09 03:49:25Z phppp $
//  ------------------------------------------------------------------------ //
//                XOOPS - PHP Content Management System                      //
//                    Copyright (c) 2000 XOOPS.org                           //
//                       <https://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.'<br />';
    }
    foreach (
$xoopsConfigUser['bad_emails'] as $be) {
        if (!empty(
$be) && preg_match("/".$be."/i"$email)) {
            
$stop .= _US_INVALIDMAIL.'<br />';
            break;
        }
    }
    if (
strrpos($email,' ') > 0) {
        
$stop .= _US_EMAILNOSPACES.'<br />';
    }
    
$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.'<br />';
    }
    if ( (isset(
$pass)) && ($pass != $vpass) ) {
        
$stop .= _US_PASSNOTSAME.'<br />';
    } 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('<br />', $GLOBALS['xoopsSecurity']->getErrors())."<br />";
    }
    if (
$xoopsConfigUser['reg_dispdsclmr'] != 0 && $xoopsConfigUser['reg_disclaimer'] != '') {
        if (empty(
$agree_disc)) {
            
$stop .= _US_UNEEDAGREE.'<br />';
        }
    }
    
$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).'<br />';
        }
        
$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;'>$stop</span>";
        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('<br />', $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;'>$stop</span>";
        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
<?php
// $Id: user.php 1282 2008-01-29 04:26:44Z phppp $
//  ------------------------------------------------------------------------ //
//                XOOPS - PHP Content Management System                      //
//                    Copyright (c) 2000 XOOPS.org                           //
//                       <https://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.'<br />'._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.'<br/>'._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();
    }
}
?>





TopTop



Login

Who's Online

153 user(s) are online (100 user(s) are browsing Support Forums)


Members: 0


Guests: 153


more...

Donat-O-Meter

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

Latest GitHub Commits