Example #1
0
 function prepare2upgrade()
 {
     include_once XOOPS_ROOT_PATH . '/modules/AMS/upgrade/class/dbmanager.php';
     include_once XOOPS_ROOT_PATH . '/modules/AMS/upgrade/language/install.php';
     $dbm = new db_manager();
     $dbm->queryFromFile(XOOPS_ROOT_PATH . '/modules/AMS/sql/mysql.sql');
     return $dbm->report();
 }
Example #2
0
 public function getTestsByCategory($id_category)
 {
     $query1 = "SELECT table_name FROM categories WHERE id='{$id_category}'";
     $result1 = mysql_query($query1);
     $row = mysql_fetch_row($result1);
     $table_name = $row[0];
     $query2 = "SELECT * FROM {$table_name}";
     $result2 = mysql_query($query2);
     $resultToArray = db_manager::db_result_to_array($result2);
     //print_r($resultToArray);
     $xml = db_manager::makeTestsXmlString($resultToArray);
     return $xml;
 }
Example #3
0
    }
    if (!is_dir(XOOPS_TRUST_PATH . '/modules')) {
        icms_core_Filesystem::copyRecursive(XOOPS_ROOT_PATH . '/install/modules/protector/trust_path/modules', XOOPS_TRUST_PATH . '/modules');
    }
    if (!is_dir(XOOPS_TRUST_PATH . '/modules/protector')) {
        icms_core_Filesystem::copyRecursive(XOOPS_ROOT_PATH . '/install/modules/protector/trust_path/modules/protector', XOOPS_TRUST_PATH . '/modules/protector');
    }
    icms_core_Filesystem::chmod(XOOPS_ROOT_PATH . '/modules', 0755);
}
$wizard->setPage('tablescreate');
$pageHasForm = true;
$pageHasHelp = false;
$vars =& $_SESSION['settings'];
include_once "../mainfile.php";
include_once './class/dbmanager.php';
$dbm = new db_manager();
if (!$dbm->isConnectable()) {
    $wizard->redirectToPage('-3');
    exit;
}
$process = '';
if (!$dbm->tableExists('users')) {
    $process = 'create';
}
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    // If there's nothing to do: switch to next page
    if (empty($process)) {
        $wizard->redirectToPage('+1');
        exit;
    }
    $tables = array();
Example #4
0
                if (OldNewsTopic::copyPermissions($newsModule->getVar('mid'))) {
                    echo "Permissions Copied <br />";
                } else {
                    echo "Error: Permissions NOT copied <br />";
                }
            }
            break;
        case "Update":
            /*
                    include_once XOOPS_ROOT_PATH."/modules/AMS/include/update.php";
                    xoops_module_update_AMS($xoopsModule, 220); //invoke update procedure - the SQL will fail if already upgraded, but no harm should come to it.
                    header('location: '.XOOPS_URL.'/modules/system/admin.php?fct=modulesadmin&op=update&module=AMS');
                    exit();*/
            include_once XOOPS_ROOT_PATH . '/modules/AMS/upgrade/class/dbmanager.php';
            include_once XOOPS_ROOT_PATH . '/modules/AMS/upgrade/language/install.php';
            $dbm = new db_manager();
            $dbm->queryFromFile(XOOPS_ROOT_PATH . '/modules/AMS/sql/upgrade.sql');
            $feedback = $dbm->report();
            echo $feedback;
            echo "<br /><br /><a href='" . XOOPS_URL . "/modules/system/admin.php?fct=modulesadmin&op=update&module=AMS'>Proceed</a>";
            xoops_cp_footer();
            exit;
    }
}
include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
$upgrade_form = new XoopsThemeForm('Upgrade', 'upgradeform', 'index.php');
if (!isset($_POST['submit'])) {
    $upgrade_form->addElement(new XoopsFormButton('Import Articles and Topics from News module', 'submit', 'Import', 'submit'));
    $upgrade_form->addElement(new XoopsFormButton('Articles and Topics ARE Imported Earlier, Proceed to Next Step', 'submit', 'Proceed', 'submit'));
} else {
    $upgrade_form->addElement(new XoopsFormButton('MOVE Comments From News Articles to AMS Articles', 'submit', 'Comments', 'submit'));
if (!preg_match("/^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+([\\.][a-z0-9-]+)+\$/i", $adminmail)) {
    $wizard->setContent('<p>' . _INSTALL_L73 . '</p>');
    $wizard->setBack(array('', _INSTALL_L112));
    $wizard->error();
    exit;
}
if (!isset($adminname) || !isset($adminpass) || !isset($adminmail) || $adminmail == "" || $adminname == "" || $adminpass == "" || $adminpass != $adminpass2) {
    $wizard->setContent('<p>' . _INSTALL_L41 . '</p>');
    $wizard->setBack(array('', _INSTALL_L112));
    $wizard->error();
    exit;
}
include_once '../mainfile.php';
include_once './include/makedata.php';
include_once './class/dbmanager.php';
$dbm = new db_manager();
include_once './class/cachemanager.php';
$cm = new cache_manager();
$language = check_language($language);
if (file_exists('./language/' . $language . '/install2.php')) {
    include_once './language/' . $language . '/install2.php';
} elseif (file_exists('./language/english/install2.php')) {
    include_once './language/english/install2.php';
    $language = 'english';
} else {
    echo 'no language file (install2.php).';
    exit;
}
//$tables = array();
$result = $dbm->queryFromFile('./sql/' . (XOOPS_DB_TYPE === 'mysqli' ? 'mysql' : XOOPS_DB_TYPE) . '.data.sql');
$result = $dbm->queryFromFile('./language/' . $language . '/' . (XOOPS_DB_TYPE === 'mysqli' ? 'mysql' : XOOPS_DB_TYPE) . '.lang.data.sql');
Example #6
0
 * @author		Haruki Setoyama  <*****@*****.**>
 * @author 		Kazumi Ono <*****@*****.**>
 * @author		Skalpa Keo <*****@*****.**>
 * @version		$Id: page_tablesfill.php 11750 2012-06-28 15:31:34Z m0nty $
 */
require_once 'common.inc.php';
if (!defined('XOOPS_INSTALL')) {
    exit;
}
$wizard->setPage('tablesfill');
$pageHasForm = false;
$pageHasHelp = false;
$vars =& $_SESSION['settings'];
include_once "../mainfile.php";
include_once './class/dbmanager.php';
$dbm = new db_manager();
if (!$dbm->isConnectable()) {
    $wizard->redirectToPage('dbsettings');
    exit;
}
$res = $dbm->query("SELECT COUNT(*) FROM " . $dbm->db->prefix("users"));
if (!$res) {
    $wizard->redirectToPage('dbsettings');
    exit;
}
list($count) = $dbm->db->fetchRow($res);
$process = $count ? '' : 'insert';
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    if (!$process) {
        $wizard->redirectToPage('+0');
        exit;
Example #7
0
// in case no RPC servers are available stop jorge
if ($rpc_host === false) {
    print "<br><center><b>Currently service is unavailable. Please try again later.</b></center>";
    exit;
}
// connect to xmpp server
$ejabberd_rpc = new rpc_connector("{$rpc_host}", "{$rpc_port}", XMPP_HOST);
// initialize encryption system
$enc = new url_crypt(ENC_KEY);
// authenticate
if (check_registered_user($sess, $ejabberd_rpc, $enc) !== true) {
    header("Location: index.php?act=logout");
    exit;
}
// create database object
$db = new db_manager(MYSQL_HOST, MYSQL_NAME, MYSQL_USER, MYSQL_PASS, "mysql", "{$xmpp_host}");
// set user data
define(TOKEN, $sess->get('uid_l'));
$db->get_user_id(TOKEN);
define(USER_ID, $db->result->user_id);
if (!ctype_digit(USER_ID)) {
    // exit on unexpected results
    exit;
} else {
    $db->set_user_id(USER_ID);
}
// get parameters
$e_string = $_GET['a'];
if ($enc->decrypt_url($e_string) === true) {
    $tslice = $enc->tslice;
    $talker = $enc->peer_name_id;
Example #8
0
<?php

/**
 *
 * @package Legacy
 * @version $Id: install_createTables.inc.php,v 1.3 2008/09/25 15:12:35 kilica Exp $
 * @copyright Copyright 2005-2007 XOOPS Cube Project  <https://github.com/xoopscube/legacy>
 * @license https://github.com/xoopscube/legacy/blob/master/docs/GPL_V2.txt GNU GENERAL PUBLIC LICENSE Version 2
 *
 */
include_once '../mainfile.php';
include_once './class/dbmanager.php';
$dbm = new db_manager();
$tables = array();
$result = $dbm->queryFromFile('./sql/' . XOOPS_DB_TYPE . '.structure.sql');
$wizard->assign('reports', $dbm->report());
if (!$result) {
    $wizard->assign('message', _INSTALL_L114);
    $wizard->setBack(array('start', _INSTALL_L103));
} else {
    $wizard->assign('message', _INSTALL_L115);
}
$wizard->render('install_createTables.tpl.php');
<?php

/**
 *
 * @package Legacy
 * @version $Id: install_createDB.inc.php,v 1.3 2008/09/25 15:12:20 kilica Exp $
 * @copyright Copyright 2005-2007 XOOPS Cube Project  <http://xoopscube.sourceforge.net/> 
 * @license http://xoopscube.sourceforge.net/license/GPL_V2.txt GNU GENERAL PUBLIC LICENSE Version 2
 *
 */
include_once '../mainfile.php';
include_once './class/dbmanager.php';
$dbm = new db_manager();
if (!$dbm->createDB()) {
    $wizard->setContent('<p>' . _INSTALL_L31 . '</p>');
    $wizard->setNext(array('checkDB', _INSTALL_L104));
    $wizard->setBack(array('start', _INSTALL_L103));
} else {
    $wizard->setContent('<div class="confirmOk">' . sprintf(_INSTALL_L43, XOOPS_DB_NAME) . '</div>');
}
$wizard->render();
Example #10
0
 /**
  * TableInfo constructor.
  * @param $table_name
  */
 public function __construct($table_name)
 {
     $this->db_manager = db_manager::getInstance();
     $this->table_name = $table_name;
     $this->setTableFields();
 }
 * @license http://xoopscube.sourceforge.net/license/GPL_V2.txt GNU GENERAL PUBLIC LICENSE Version 2
 *
 */
include_once "../mainfile.php";
$language = check_language($language);
if (file_exists("./language/" . $language . "/install2.php")) {
    include_once "./language/" . $language . "/install2.php";
} elseif (file_exists("./language/english/install2.php")) {
    include_once "./language/english/install2.php";
    $language = 'english';
} else {
    echo 'no language file (install2.php).';
    exit;
}
include_once './class/dbmanager.php';
$dbm = new db_manager();
// default settings
$xoopsConfig['sitename'] = 'XOOPS Cube Site';
$xoopsConfig['slogan'] = 'Just use it!';
$xoopsConfig['adminmail'] = '';
$xoopsConfig['language'] = 'english';
$xoopsConfig['anonymous'] = 'Anonymous';
$xoopsConfig['minpass'] = 5;
$xoopsConfig['anonpost'] = 0;
$xoopsConfig['new_user_notify'] = 0;
$xoopsConfig['new_user_notify_group'] = 1;
$xoopsConfig['self_delete'] = 0;
$xoopsConfig['gzip_compression'] = 0;
$xoopsConfig['uname_test_level'] = 0;
$xoopsConfig['usercookie'] = "xoops_user";
$xoopsConfig['sessioncookie'] = "xoops_session";
                    if ($config_handler->insertConfig($confobj) != false) {
                        $msgs[] = '&nbsp;&nbsp;Config <b>' . $config['name'] . '</b> added to the database.' . $confop_msgs;
                    } else {
                        $msgs[] = '&nbsp;&nbsp;<span style="color:#ff0000;">ERROR: Could not insert config <b>' . $config['name'] . '</b> to the database.</span>';
                    }
                    unset($confobj);
                }
                unset($configs);
            }
            foreach ($msgs as $msg) {
                echo '<code>' . $msg . '</code><br />';
            }
        }
        // data for table 'block_module_link'
        include_once './class/dbmanager.php';
        $dbm = new db_manager();
        $sql = 'SELECT bid, side FROM ' . $dbm->prefix('newblocks');
        $result = $dbm->query($sql);
        while ($myrow = $dbm->fetchArray($result)) {
            if ($myrow['side'] == 0) {
                $dbm->insert("block_module_link", " VALUES (" . $myrow['bid'] . ", 0)");
            } else {
                $dbm->insert("block_module_link", " VALUES (" . $myrow['bid'] . ", -1)");
            }
        }
    }
    echo '<br />';
    flush();
    sleep(1);
}
$title = _INSTALL_L142;
Example #13
0
    if (!preg_match("/^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+([\\.][a-z0-9-]+)+\$/i", $vars['adminmail'])) {
        $error['email'][] = ERR_INVALID_EMAIL;
    }
    if ($vars['adminpass'] != $vars['adminpass2']) {
        $error['pass'][] = ERR_PASSWORD_MATCH;
    }
    if ($error) {
        $wizard->redirectToPage('+0');
        return 200;
    } else {
        $wizard->redirectToPage('+1');
        return 302;
    }
} else {
    include_once './class/dbmanager.php';
    $dbm = new db_manager();
    if (!$dbm->isConnectable()) {
        $wizard->redirectToPage('dbsettings');
        exit;
    }
    $res = $dbm->query("SELECT COUNT(*) FROM " . $dbm->db->prefix("users"));
    list($isadmin) = $dbm->db->fetchRow($res);
}
ob_start();
if ($isadmin) {
    $pageHasForm = false;
    $pageHasHelp = false;
    echo "<div class='x2-note errorMsg'>" . ADMIN_EXIST . "</div>\n";
} else {
    ?>
    <fieldset>
    $mm = new mainfile_manager("../mainfile.php");
    $mm->setRewrite('XOOPS_GROUP_ADMIN', $g_webmasters);
    $mm->setRewrite('XOOPS_GROUP_USERS', $g_users);
    $mm->setRewrite('XOOPS_GROUP_ANONYMOUS', $g_anonymous);
    $ret = $mm->doRewrite();
    if (!$ret) {
        $content = _INSTALL_L60;
        include './install_tpl.php';
        exit;
    }
}
if (false != $error) {
    $b_back = array();
    $content = _INSTALL_L162;
    include './install_tpl.php';
    break;
}
include_once './class/dbmanager.php';
$dbm = new db_manager();
if (!$dbm->query("ALTER TABLE " . $dbm->prefix("newblocks") . " ADD dirname VARCHAR(50) NOT NULL, ADD func_file VARCHAR(50) NOT NULL, ADD show_func VARCHAR(50) NOT NULL, ADD edit_func VARCHAR(50) NOT NULL")) {
}
$result = $dbm->queryFromFile('./sql/upgrade/' . XOOPS_DB_TYPE . '.structure.sql');
$content = $dbm->report();
if (!$result) {
    $content .= "<p>" . _INSTALL_L135 . "</p>\n";
    $b_back = array();
} else {
    $content .= "<p>" . _INSTALL_L136 . "</p>\n";
    $b_next = array('updateConfig', _INSTALL_L14);
}
include './install_tpl.php';
 *
 * @copyright   The XOOPS project http://www.xoops.org/
 * @license     http://www.fsf.org/copyleft/gpl.html GNU General Public License (GPL)
 * @package     installer
 * @since       2.3.0
 * @author      Haruki Setoyama  <*****@*****.**>
 * @author      Kazumi Ono <*****@*****.**>
 * @author      Skalpa Keo <*****@*****.**>
 * @author      Taiwen Jiang <*****@*****.**>
 * @author      DuGris (aka L. JEN) <*****@*****.**>
 * @version     $Id: page_tablescreate.php 3558 2009-09-03 01:55:38Z trabis $
**/
require_once './include/common.inc.php';
defined('XOOPS_INSTALL') or die('XOOPS Installation wizard die');
$pageHasForm = false;
$pageHasHelp = false;
$vars =& $_SESSION['settings'];
include_once "../mainfile.php";
include_once './class/dbmanager.php';
$dbm = new db_manager();
if (!$dbm->isConnectable()) {
    $wizard->redirectToPage('-3');
    exit;
}
if ($dbm->tableExists('users')) {
    $content = '<div class="x2-note confirmMsg">' . XOOPS_TABLES_FOUND . '</div>';
} else {
    $result = $dbm->queryFromFile('./sql/' . XOOPS_DB_TYPE . '.structure.sql');
    $content = '<div class="x2-note successMsg">' . XOOPS_TABLES_CREATED . "</div><br />" . $dbm->report();
}
include './include/install_tpl.php';
Example #16
0
<?php

/**
 *
 * @package Legacy
 * @version $Id: install_checkDB.inc.php,v 1.3 2008/09/25 15:12:17 kilica Exp $
 * @copyright Copyright 2005-2007 XOOPS Cube Project  <https://github.com/xoopscube/legacy>
 * @license https://github.com/xoopscube/legacy/blob/master/docs/GPL_V2.txt GNU GENERAL PUBLIC LICENSE Version 2
 *
 */
include_once '../mainfile.php';
include_once './class/dbmanager.php';
$dbm = new db_manager();
$title = _INSTALL_L104;
if (!$dbm->isConnectable()) {
    $wizard->addArray('checks', _NGIMG . _INSTALL_L106);
    $wizard->addArray('msgs', _INSTALL_L107);
    $wizard->setBack(array('start', _INSTALL_L103));
    $wizard->setReload(true);
} else {
    $wizard->addArray('checks', _OKIMG . _INSTALL_L108);
    if (!$dbm->dbExists()) {
        $wizard->addArray('checks', _NGIMG . sprintf(_INSTALL_L109, XOOPS_DB_NAME));
        $wizard->addArray('msgs', _INSTALL_L21 . '<br /><b>' . XOOPS_DB_NAME . '</b>');
        $wizard->addArray('msgs', _INSTALL_L22);
    } else {
        $wizard->addArray('checks', _OKIMG . sprintf(_INSTALL_L110, XOOPS_DB_NAME));
        if (!$dbm->tableExists('users')) {
            $wizard->addArray('msgs', _INSTALL_L111);
            $wizard->setNext(array('createTables', _INSTALL_L40));
        } else {
Example #17
0
if (!preg_match("/^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+([\\.][a-z0-9-]+)+\$/i", $adminmail)) {
    $wizard->setContent('<p>' . _INSTALL_L73 . '</p>');
    $wizard->setBack(array('', _INSTALL_L112));
    $wizard->error();
    exit;
}
if (!isset($adminname) || !isset($adminpass) || !isset($adminmail) || $adminmail == "" || $adminname == "" || $adminpass == "" || $adminpass != $adminpass2) {
    $wizard->setContent('<p>' . _INSTALL_L41 . '</p>');
    $wizard->setBack(array('', _INSTALL_L112));
    $wizard->error();
    exit;
}
include_once '../mainfile.php';
include_once './include/makedata.php';
include_once './class/dbmanager.php';
$dbm = new db_manager();
include_once './class/cachemanager.php';
$cm = new cache_manager();
$language = check_language($language);
if (file_exists('./language/' . $language . '/install2.php')) {
    include_once './language/' . $language . '/install2.php';
} elseif (file_exists('./language/english/install2.php')) {
    include_once './language/english/install2.php';
    $language = 'english';
} else {
    echo 'no language file (install2.php).';
    exit;
}
//$tables = array();
$result = $dbm->queryFromFile('./sql/' . XOOPS_DB_TYPE . '.data.sql');
$result = $dbm->queryFromFile('./language/' . $language . '/' . XOOPS_DB_TYPE . '.lang.data.sql');
Example #18
0
            $ejabberd_rpc = new rpc_connector("{$rpc_host}", "{$rpc_port}", XMPP_HOST);
            $xmpp_host = str_replace(".", "_", XMPP_HOST);
        }
    } else {
        unset($_POST['inpLogin']);
        unset($_POST['inpPass']);
        // Try to recreate db object...
        if ($_GET['act'] === "logout") {
            if ($sess->get('vhost') != "") {
                $xmpp_host = str_replace(".", "_", $sess->get('vhost'));
            }
        }
    }
}
// create db_manager object
$db = new db_manager(MYSQL_HOST, MYSQL_NAME, MYSQL_USER, MYSQL_PASS, "mysql", "{$xmpp_host}");
$db->set_debug(SQL_DEBUG);
// create encryption object
$enc = new url_crypt(ENC_KEY);
// username (token)
define(TOKEN, $sess->get('uid_l'));
//debug
debug(DEBUG, "User session:" . TOKEN);
// authentication checks. Ensure if session data is not altered... (only when we are inside Jorge)
if (!preg_match("/index.php/i", $location)) {
    if (check_registered_user($sess, $ejabberd_rpc, $enc) !== true) {
        header("Location: index.php?act=logout");
        exit;
    }
    // Load language file based on current session
    debug(DEBUG, "Selecting initial language after authentication");
<?php

/**
 *
 * @package Legacy
 * @version $Id: install_createTables.inc.php,v 1.3 2008/09/25 15:12:35 kilica Exp $
 * @copyright Copyright 2005-2007 XOOPS Cube Project  <https://github.com/xoopscube/legacy>
 * @license https://github.com/xoopscube/legacy/blob/master/docs/GPL_V2.txt GNU GENERAL PUBLIC LICENSE Version 2
 *
 */
include_once '../mainfile.php';
include_once './class/dbmanager.php';
$dbm = new db_manager();
$tables = array();
$result = $dbm->queryFromFile('./sql/' . (XOOPS_DB_TYPE === 'mysqli' ? 'mysql' : XOOPS_DB_TYPE) . '.structure.sql');
$wizard->assign('reports', $dbm->report());
if (!$result) {
    $wizard->assign('message', _INSTALL_L114);
    $wizard->setBack(array('start', _INSTALL_L103));
} else {
    $wizard->assign('message', _INSTALL_L115);
}
$wizard->render('install_createTables.tpl.php');
 *
 */
require_once 'common.inc.php';
if (!defined('XOOPS_INSTALL')) {
    exit;
}
$wizard->setPage('modulesinstall');
$pageHasForm = true;
$pageHasHelp = false;
$vars =& $_SESSION['settings'];
include_once ICMS_ROOT_PATH . "/mainfile.php";
include_once ICMS_ROOT_PATH . "/include/common.php";
include_once "../include/cp_functions.php";
include_once './class/dbmanager.php';
include "modulesadmin.php";
$dbm = new db_manager();
if (!$dbm->isConnectable()) {
    $wizard->redirectToPage('-3');
    exit;
}
$process = '';
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    $process = 'install';
}
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    // If there's nothing to do: switch to next page
    if (empty($process)) {
        $wizard->redirectToPage('+1');
        exit;
    }
    if ($_POST['mod'] == 1) {
Example #21
0
     $result = $dbm->queryFromFile('./sql/' . XOOPS_DB_TYPE . '.structure.sql');
     $content = $dbm->report();
     if (!$result) {
         //$deleted = $dbm->deleteTables($tables);
         $content .= "<p>" . _INSTALL_L114 . "</p>\n";
         $b_back = array('start', _INSTALL_L103);
     } else {
         $content .= "<p>" . _INSTALL_L115 . "</p>\n";
         $b_next = array('siteInit', _INSTALL_L112);
     }
     include 'install_tpl.php';
     break;
 case 'updateTables':
     include_once "../mainfile.php";
     include_once './class/dbmanager.php';
     $db = new db_manager();
     $sql = 'SELECT * FROM ' . $db->prefix('groups');
     $result = $db->query($sql);
     $content = '<h5>' . _INSTALL_L157 . '</h5>';
     $content .= '<table align="center" cellspacing="0" border="1"><tr><td>' . _INSTALL_L158 . '</td><td>' . _INSTALL_L159 . '</td><td>' . _INSTALL_L160 . '</td><td>' . _INSTALL_L161 . '</td></tr>';
     while ($myrow = $db->fetchArray($result)) {
         if ($myrow['type'] == 'Admin') {
             $content .= '<tr><td>' . $myrow['name'] . '</td><td><input type="radio" name="g_webmasters" value="' . $myrow['groupid'] . '" /></td><td>&nbsp;</td><td>&nbsp;</td></tr>';
         } elseif ($myrow['type'] == 'User') {
             $content .= '<tr><td>' . $myrow['name'] . '</td><td>&nbsp;</td><td><input type="radio" name="g_users" value="' . $myrow['groupid'] . '" /></td><td>&nbsp;</td></tr>';
         } else {
             $content .= '<tr><td>' . $myrow['name'] . '</td><td>&nbsp;</td><td>&nbsp;</td><td><input type="radio" name="g_anonymous" value="' . $myrow['groupid'] . '" /></td></tr>';
         }
     }
     $content .= '</table>';
     $b_back = array();
Example #22
0
 function apply_templates()
 {
     include_once '../modules/system/xoops_version.php';
     $dbm = new db_manager();
     $time = time();
     foreach ($modversion['templates'] as $tplfile) {
         // Admin templates
         if (isset($tplfile['type']) && $tplfile['type'] == 'admin' && ($fp = fopen('../modules/system/templates/admin/' . $tplfile['file'], 'r'))) {
             $newtplid = $dbm->insert('tplfile', " VALUES (0, 1, 'system', 'default', '" . addslashes($tplfile['file']) . "', '" . addslashes($tplfile['description']) . "', " . $time . ", " . $time . ", 'admin')");
             $tplsource = fread($fp, filesize('../modules/system/templates/admin/' . $tplfile['file']));
             fclose($fp);
             $dbm->insert('tplsource', " (tpl_id, tpl_source) VALUES (" . $newtplid . ", '" . addslashes($tplsource) . "')");
         }
     }
     return true;
 }