Exemplo n.º 1
0
 * @license         http://www.fsf.org/copyleft/gpl.html GNU General Public License (GPL)
 * @package         core
 * @since           2.0.0
 * @author          Kazumi Ono <*****@*****.**>
 */
include __DIR__ . '/mainfile.php';
$xoops = Xoops::getInstance();
$xoops_url = \XoopsBaseConfig::get('url');
$xoops->events()->triggerEvent('core.user.start');
$xoops->loadLanguage('user');
// from $_POST we use keys: op, ok
$clean_input = XoopsFilterInput::gather('post', array(array('op', 'string'), array('ok', 'boolean', 0, false)), 'op');
if (!$clean_input) {
    // no valid $_POST, use $_GET and set defaults
    // from $_GET we use keys: op, xoops_redirect, id, actkey
    $clean_input = XoopsFilterInput::gather('get', array(array('op', 'string', 'main', true), array('xoops_redirect', 'weburl', '', true), array('id', 'int', 0, false), array('actkey', 'string', '', true)));
}
$op = $clean_input['op'];
if ($op == 'login') {
    include_once $xoops->path('include/checklogin.php');
    exit;
}
if ($op == 'main') {
    if (!$xoops->isUser()) {
        $xoops->header('module:system/system_userform.tpl');
        $xoops->tpl()->assign('xoops_pagetitle', XoopsLocale::A_LOGIN);
        $xoops->theme()->addMeta('meta', 'keywords', XoopsLocale::USERNAME . ", " . XoopsLocale::PASSWORD . ", " . XoopsLocale::Q_LOST_YOUR_PASSWORD);
        $xoops->theme()->addMeta('meta', 'description', XoopsLocale::Q_LOST_YOUR_PASSWORD . " " . XoopsLocale::NO_PROBLEM_ENTER_EMAIL_WE_HAVE_ON_FILE);
        $xoops->tpl()->assign('lang_login', XoopsLocale::A_LOGIN);
        $xoops->tpl()->assign('lang_username', XoopsLocale::C_USERNAME);
        if (isset($clean_input['xoops_redirect'])) {
Exemplo n.º 2
0
 * 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       XOOPS Project (http://xoops.org)
 * @license         GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
 * @package         include
 * @since           2.0.0
 * @version         $Id$
 * @todo            Will be refactored
 */
use Xoops\Core\FixedGroups;
$xoops = Xoops::getInstance();
$xoops_url = \XoopsBaseConfig::get('url');
// from $_POST we use keys: uname, pass, rememberme, xoops_redirect
$clean_input = XoopsFilterInput::gather('post', array(array('uname', 'string', '', true), array('pass', 'string', '', true), array('rememberme', 'boolean', 0, false), array('xoops_redirect', 'weburl', '', true)));
$uname = $clean_input['uname'];
$pass = $clean_input['pass'];
if ($uname == '' || $pass == '') {
    $xoops->redirect($xoops_url . '/user.php', 1, XoopsLocale::E_INCORRECT_LOGIN);
    exit;
}
$member_handler = $xoops->getHandlerMember();
$xoopsAuth = \Xoops\Auth\Factory::getAuthConnection($uname);
$user = $xoopsAuth->authenticate($uname, $pass);
if (false != $user) {
    /* @var $user XoopsUser */
    if (0 == $user->getVar('level')) {
        $xoops->redirect($xoops_url . '/index.php', 5, XoopsLocale::E_SELECTED_USER_DEACTIVATED_OR_NOT_ACTIVE);
        exit;
    }
Exemplo n.º 3
0
 */
include __DIR__ . '/mainfile.php';
$xoops = Xoops::getInstance();
$xoops_url = \XoopsBaseConfig::get('url');
$xoops->events()->triggerEvent('core.register.start');
$xoops->loadLanguage('user');
$myts = \Xoops\Core\Text\Sanitizer::getInstance();
$xoopsConfigUser = $xoops->getConfigs();
if (empty($xoopsConfigUser['allow_register'])) {
    $xoops->redirect('index.php', 6, XoopsLocale::E_WE_ARE_CLOSED_FOR_REGISTRATION);
}
// from $_POST we use keys: op, uname, email, url, pass, vpass, timezone,
//                          user_viewemail, user_mailok, agree_disc
$clean_input = XoopsFilterInput::gather('post', array(array('op', 'string', 'register', true), array('uname', 'string', '', true), array('email', 'string', '', true), array('url', 'weburl', '', true), array('pass', 'string', '', true), array('vpass', 'string', '', true), array('timezone', 'string', $xoopsConfig['default_TZ'], false), array('user_viewemail', 'boolean', false, false), array('user_mailok', 'boolean', false, false), array('agree_disc', 'boolean', false, false)));
// from $_GET we use keys: op, id, actkey
$clean_get_input = XoopsFilterInput::gather('get', array(array('op', 'string', 'register', true), array('id', 'int'), array('actkey', 'string', '', true)), 'actkey');
// move clean array to individual variables
$op = $clean_input['op'];
$uname = $clean_input['uname'];
$email = $clean_input['email'];
$url = $clean_input['url'];
$pass = $clean_input['pass'];
$vpass = $clean_input['vpass'];
$timezone = $clean_input['timezone'];
$user_viewemail = $clean_input['user_viewemail'];
$user_mailok = $clean_input['user_mailok'];
$agree_disc = $clean_input['agree_disc'];
// if this is an activation, use get
if ($clean_get_input !== false) {
    $op = $clean_get_input['op'];
    $id = $clean_get_input['id'];
Exemplo n.º 4
0
 * @copyright       XOOPS Project (http://xoops.org)
 * @license         GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
 * @author          Richard Griffith <*****@*****.**>
 */
require __DIR__ . '/admin_header.php';
/* --------------------------------------------------------------- */
use Xmf\Debug;
use Xoops\Core\Database\Schema\ExportVisitor;
use Xoops\Core\Database\Schema\ImportSchema;
use Xoops\Core\Database\Schema\RemovePrefixes;
use Xoops\Core\Yaml;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Schema\Comparator;
use Doctrine\DBAL\Schema\Synchronizer\SingleDatabaseSynchronizer;
// from $_POST we use keys: op, mod_dirname
$clean_input = XoopsFilterInput::gather('post', array(array('op', 'string', 'selectmodule', true), array('mod_dirname', 'string', '', true)));
$op = $clean_input['op'];
$mod_dirname = $clean_input['mod_dirname'];
if ($op !== 'showschema' || empty($mod_dirname)) {
    $op = 'selectmodule';
}
//echo '<h2>' . _MI_SCHEMATOOL_NAME . '</h2>';
$indexAdmin = new \Xoops\Module\Admin();
$indexAdmin->displayNavigation('schematool.php');
if ($op === 'showschema') {
    $helper = $xoops->getModuleHelper($mod_dirname);
    $mod_to_use = $helper->getModule();
    $mod_to_use->loadInfo($mod_dirname, false);
    $mod_ver = $mod_to_use->modinfo;
    $table_list = array();
    if (isset($mod_ver['tables'])) {