XOOPS PHP Cross Reference Web Portal Systems

Source: /install/include/makedata.php - 333 lines - 32082 bytes - Summary - Text - Print

Description: Installer data generation file

   1  <?php
   2  /*

   3   You may not change or alter any portion of this comment or credits

   4   of supporting developers from this source code or any supporting source code

   5   which is considered copyrighted (c) material of the original comment or credit authors.

   6  

   7   This program is distributed in the hope that it will be useful,

   8   but WITHOUT ANY WARRANTY; without even the implied warranty of

   9   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

  10  */
  11  /**

  12  * Installer data generation file

  13  *

  14  * See the enclosed file license.txt for licensing information.

  15  * If you did not receive this file, get it at http://www.fsf.org/copyleft/gpl.html

  16  *

  17  * @copyright The XOOPS project http://www.xoops.org/

  18  * @license http://www.fsf.org/copyleft/gpl.html GNU General Public License (GPL)

  19  * @package installer

  20  * @since 2.3.0

  21  * @author Haruki Setoyama <haruki@planewave.org>

  22  * @author Kazumi Ono <webmaster@myweb.ne.jp>

  23  * @author Skalpa Keo <skalpa@xoops.org>

  24  * @author Taiwen Jiang <phppp@users.sourceforge.net>

  25  * @author DuGris (aka L. JEN) <dugris@frxoops.org>

  26  * @version $Id: makedata.php 9488 2012-05-12 10:39:59Z beckmi $

  27  */
  28  // include_once './class/dbmanager.php';

  29  // RMV

  30  // TODO: Shouldn't we insert specific field names??  That way we can use

  31  // the defaults specified in the database...!!!! (and don't have problem

  32  // of missing fields in install file, when add new fields to database)

  33  function make_groups(&$dbm)
  34  {
  35      $gruops['XOOPS_GROUP_ADMIN'] = $dbm->insert('groups', " VALUES (1, '" . addslashes(_INSTALL_WEBMASTER) . "', '" . addslashes(_INSTALL_WEBMASTERD) . "', 'Admin')");
  36      $gruops['XOOPS_GROUP_USERS'] = $dbm->insert('groups', " VALUES (2, '" . addslashes(_INSTALL_REGUSERS) . "', '" . addslashes(_INSTALL_REGUSERSD) . "', 'User')" );
  37      $gruops['XOOPS_GROUP_ANONYMOUS'] = $dbm->insert('groups', " VALUES (3, '" . addslashes(_INSTALL_ANONUSERS) . "', '" . addslashes(_INSTALL_ANONUSERSD) . "', 'Anonymous')");
  38      if (!$gruops['XOOPS_GROUP_ADMIN'] || !$gruops['XOOPS_GROUP_USERS'] || !$gruops['XOOPS_GROUP_ANONYMOUS']) {
  39          return false;
  40      }
  41      return $gruops;
  42  }
  43  
  44  function make_data(&$dbm, $adminname, $adminpass, $adminmail, $language, $gruops)
  45  {
  46      // $xoopsDB =& Database::getInstance();

  47      // $dbm = new db_manager;

  48      $tables = array();
  49      // data for table 'groups_users_link'

  50      $dbm->insert('groups_users_link', " VALUES (0, " . $gruops['XOOPS_GROUP_ADMIN'] . ", 1)");
  51      $dbm->insert('groups_users_link', " VALUES (0, " . $gruops['XOOPS_GROUP_USERS'] . ", 1)");
  52      // data for table 'group_permission'

  53      $dbm->insert("group_permission", " VALUES (0," . $gruops['XOOPS_GROUP_ADMIN'] . ",1,1,'module_admin')");
  54      $dbm->insert("group_permission", " VALUES (0," . $gruops['XOOPS_GROUP_ADMIN'] . ",1,1, 'module_read')");
  55      $dbm->insert("group_permission", " VALUES (0," . $gruops['XOOPS_GROUP_USERS'] . ",1,1,'module_read')");
  56      $dbm->insert("group_permission", " VALUES (0," . $gruops['XOOPS_GROUP_ANONYMOUS'] . ",1,1,'module_read')");
  57  
  58      $dbm->insert("group_permission", " VALUES(0," . $gruops['XOOPS_GROUP_ADMIN'] . ",1,1,'system_admin')");
  59      $dbm->insert("group_permission", " VALUES(0," . $gruops['XOOPS_GROUP_ADMIN'] . ",2,1,'system_admin')");
  60      $dbm->insert("group_permission", " VALUES(0," . $gruops['XOOPS_GROUP_ADMIN'] . ",3,1,'system_admin')");
  61      $dbm->insert("group_permission", " VALUES(0," . $gruops['XOOPS_GROUP_ADMIN'] . ",4,1,'system_admin')");
  62      $dbm->insert("group_permission", " VALUES(0," . $gruops['XOOPS_GROUP_ADMIN'] . ",5,1,'system_admin')");
  63      $dbm->insert("group_permission", " VALUES(0," . $gruops['XOOPS_GROUP_ADMIN'] . ",6,1,'system_admin')");
  64      $dbm->insert("group_permission", " VALUES(0," . $gruops['XOOPS_GROUP_ADMIN'] . ",7,1,'system_admin')");
  65      $dbm->insert("group_permission", " VALUES(0," . $gruops['XOOPS_GROUP_ADMIN'] . ",8,1,'system_admin')");
  66      $dbm->insert("group_permission", " VALUES(0," . $gruops['XOOPS_GROUP_ADMIN'] . ",9,1,'system_admin')");
  67      $dbm->insert("group_permission", " VALUES(0," . $gruops['XOOPS_GROUP_ADMIN'] . ",10,1,'system_admin')");
  68      $dbm->insert("group_permission", " VALUES(0," . $gruops['XOOPS_GROUP_ADMIN'] . ",11,1,'system_admin')");
  69      $dbm->insert("group_permission", " VALUES(0," . $gruops['XOOPS_GROUP_ADMIN'] . ",12,1,'system_admin')");
  70      $dbm->insert("group_permission", " VALUES(0," . $gruops['XOOPS_GROUP_ADMIN'] . ",13,1,'system_admin')");
  71      $dbm->insert("group_permission", " VALUES(0," . $gruops['XOOPS_GROUP_ADMIN'] . ",14,1,'system_admin')");
  72      $dbm->insert("group_permission", " VALUES(0," . $gruops['XOOPS_GROUP_ADMIN'] . ",15,1,'system_admin')");
  73      $dbm->insert("group_permission", " VALUES(0," . $gruops['XOOPS_GROUP_ADMIN'] . ",16,1,'system_admin')");
  74      $dbm->insert("group_permission", " VALUES(0," . $gruops['XOOPS_GROUP_ADMIN'] . ",17,1,'system_admin')");
  75      // data for table 'banner'

  76      $dbm->insert("banner", " (bid, cid, imptotal, impmade, clicks, imageurl, clickurl, date, htmlcode) VALUES (1, 1, 0, 1, 0, '" . XOOPS_URL . "/images/banners/xoops_flashbanner2.swf', 'http://www.xoops.org/', 1008813250, '')");
  77      $dbm->insert("banner", " (bid, cid, imptotal, impmade, clicks, imageurl, clickurl, date, htmlcode) VALUES (2, 1, 0, 1, 0, '" . XOOPS_URL . "/images/banners/xoops_banner_2.gif', 'http://www.xoops.org/', 1008813250, '')");
  78      $dbm->insert("banner", " (bid, cid, imptotal, impmade, clicks, imageurl, clickurl, date, htmlcode) VALUES (3, 1, 0, 1, 0, '" . XOOPS_URL . "/images/banners/banner.swf', 'http://www.xoops.org/', 1008813250, '')");
  79      // default theme

  80      $time = time();
  81      $dbm->insert('tplset', " VALUES (1, 'default', 'XOOPS Default Template Set', '', " . $time . ")");
  82      // system modules

  83      if (file_exists('../modules/system/language/' . $language . '/modinfo.php')) {
  84          include '../modules/system/language/' . $language . '/modinfo.php';
  85      } else {
  86          include  '../modules/system/language/english/modinfo.php';
  87          $language = 'english';
  88      }
  89  
  90      $modversion = array();
  91      include_once  '../modules/system/xoops_version.php';
  92      $time = time();
  93      // RMV-NOTIFY (updated for extra column in table)

  94      $dbm->insert("modules", " VALUES (1, '" . _MI_SYSTEM_NAME . "', " . ($modversion['version'] * 100) . ", " . $time . ", 0, 1, 'system', 0, 1, 0, 0, 0, 0)");
  95  
  96      foreach ($modversion['templates'] as $tplfile) {
  97          // Main templates

  98          if ($fp = fopen('../modules/system/templates/' . $tplfile['file'], 'r')) {
  99              $newtplid = $dbm->insert('tplfile', " VALUES (0, 1, 'system', 'default', '" . addslashes($tplfile['file']) . "', '" . addslashes($tplfile['description']) . "', " . $time . ", " . $time . ", 'module')");
 100              // $newtplid = $xoopsDB->getInsertId();

 101              $tplsource = fread($fp, filesize('../modules/system/templates/' . $tplfile['file']));
 102              fclose($fp);
 103              $dbm->insert('tplsource', " (tpl_id, tpl_source) VALUES (" . $newtplid . ", '" . addslashes($tplsource) . "')");
 104          }
 105          // Admin templates

 106          if ($fp = fopen('../modules/system/templates/admin/' . $tplfile['file'], 'r')) {
 107              $newtplid = $dbm->insert('tplfile', " VALUES (0, 1, 'system', 'default', '" . addslashes($tplfile['file']) . "', '" . addslashes($tplfile['description']) . "', " . $time . ", " . $time . ", 'admin')");
 108              // $newtplid = $xoopsDB->getInsertId();

 109              $tplsource = fread($fp, filesize('../modules/system/templates/admin/' . $tplfile['file']));
 110              fclose($fp);
 111              $dbm->insert('tplsource', " (tpl_id, tpl_source) VALUES (" . $newtplid . ", '" . addslashes($tplsource) . "')");
 112          }
 113      }
 114  
 115      foreach ($modversion['blocks'] as $func_num => $newblock) {
 116          if ($fp = fopen('../modules/system/templates/blocks/' . $newblock['template'], 'r')) {
 117              if (in_array($newblock['template'], array('system_block_user.html', 'system_block_login.html', 'system_block_mainmenu.html'))) {
 118                  $visible = 1;
 119              } else {
 120                  $visible = 0;
 121              }
 122              $options = !isset($newblock['options']) ? '' : trim($newblock['options']);
 123              $edit_func = !isset($newblock['edit_func']) ? '' : trim($newblock['edit_func']);
 124              $newbid = $dbm->insert('newblocks', " VALUES (0, 1, " . $func_num . ", '" . addslashes($options) . "', '" . addslashes($newblock['name']) . "', '" . addslashes($newblock['name']) . "', '', 0, 0, " . $visible . ", 'S', 'H', 1, 'system', '" . addslashes($newblock['file']) . "', '" . addslashes($newblock['show_func']) . "', '" . addslashes($edit_func) . "', '" . addslashes($newblock['template']) . "', 0, " . $time . ")");
 125              // $newbid = $xoopsDB->getInsertId();

 126              $newtplid = $dbm->insert('tplfile', " VALUES (0, " . $newbid . ", 'system', 'default', '" . addslashes($newblock['template']) . "', '" . addslashes($newblock['description']) . "', " . $time . ", " . $time . ", 'block')");
 127              // $newtplid = $xoopsDB->getInsertId();

 128              $tplsource = fread($fp, filesize('../modules/system/templates/blocks/' . $newblock['template']));
 129              fclose($fp);
 130              $dbm->insert('tplsource', " (tpl_id, tpl_source) VALUES (" . $newtplid . ", '" . addslashes($tplsource) . "')");
 131              $dbm->insert("group_permission", " VALUES (0, " . $gruops['XOOPS_GROUP_ADMIN'] . ", " . $newbid . ", 1, 'block_read')");
 132              // $dbm->insert("group_permission", " VALUES (0, ".$gruops['XOOPS_GROUP_ADMIN'].", ".$newbid.", 'xoops_blockadmiin')");

 133              $dbm->insert("group_permission", " VALUES (0, " . $gruops['XOOPS_GROUP_USERS'] . ", " . $newbid . ", 1, 'block_read')");
 134              $dbm->insert("group_permission", " VALUES (0, " . $gruops['XOOPS_GROUP_ANONYMOUS'] . ", " . $newbid . ", 1, 'block_read')");
 135          }
 136      }
 137      // data for table 'users'

 138      $temp = md5($adminpass);
 139      $regdate = time();
 140      // $dbadminname= addslashes($adminname);

 141      // RMV-NOTIFY (updated for extra columns in user table)

 142      $dbm->insert('users', " VALUES (1,'','" . addslashes($adminname) . "','" . addslashes($adminmail) . "','" . XOOPS_URL . "/','avatars/blank.gif','" . $regdate . "','','','',1,'','','','','" . $temp . "',0,0,7,5,'default','0.0'," . time() . ",'flat',0,1,0,'','','',0)");
 143      // data for table 'block_module_link'

 144      $sql = 'SELECT bid, side FROM ' . $dbm->prefix('newblocks');
 145      $result = $dbm->query($sql);
 146  
 147      while ($myrow = $dbm->fetchArray($result)) {
 148          if ($myrow['side'] == 0) {
 149              $dbm->insert("block_module_link", " VALUES (" . $myrow['bid'] . ", 0)");
 150          } else {
 151              $dbm->insert("block_module_link", " VALUES (" . $myrow['bid'] . ", -1)");
 152          }
 153      }
 154      // data for table 'config'

 155      $dbm->insert('config', " VALUES (1, 0, 1, 'sitename', '_MD_AM_SITENAME', 'XOOPS Site', '_MD_AM_SITENAMEDSC', 'textbox', 'text', 0)");
 156      $dbm->insert('config', " VALUES (2, 0, 1, 'slogan', '_MD_AM_SLOGAN', 'Just Use it!', '_MD_AM_SLOGANDSC', 'textbox', 'text', 2)");
 157      $dbm->insert('config', " VALUES (3, 0, 1, 'language', '_MD_AM_LANGUAGE', '" . addslashes($language) . "', '_MD_AM_LANGUAGEDSC', 'language', 'other', 4)");
 158      $dbm->insert('config', " VALUES (4, 0, 1, 'startpage', '_MD_AM_STARTPAGE', '--', '_MD_AM_STARTPAGEDSC', 'startpage', 'other', 6)");
 159      $dbm->insert('config', " VALUES (5, 0, 1, 'server_TZ', '_MD_AM_SERVERTZ', '0', '_MD_AM_SERVERTZDSC', 'timezone', 'float', 8)");
 160      $dbm->insert('config', " VALUES (6, 0, 1, 'default_TZ', '_MD_AM_DEFAULTTZ', '0', '_MD_AM_DEFAULTTZDSC', 'timezone', 'float', 10)");
 161      $dbm->insert('config', " VALUES (7, 0, 1, 'theme_set', '_MD_AM_DTHEME', 'default', '_MD_AM_DTHEMEDSC', 'theme', 'other', 12)");
 162      $dbm->insert('config', " VALUES (8, 0, 1, 'anonymous', '_MD_AM_ANONNAME', '" . addslashes(_INSTALL_ANON) . "', '_MD_AM_ANONNAMEDSC', 'textbox', 'text', 15)");
 163      $dbm->insert('config', " VALUES (9, 0, 1, 'gzip_compression', '_MD_AM_USEGZIP', '0', '_MD_AM_USEGZIPDSC', 'yesno', 'int', 16)");
 164      $dbm->insert('config', " VALUES (10, 0, 1, 'usercookie', '_MD_AM_USERCOOKIE', 'xoops_user', '_MD_AM_USERCOOKIEDSC', 'textbox', 'text', 18)");
 165      $dbm->insert('config', " VALUES (11, 0, 1, 'session_expire', '_MD_AM_SESSEXPIRE', '15', '_MD_AM_SESSEXPIREDSC', 'textbox', 'int', 22)");
 166      $dbm->insert('config', " VALUES (12, 0, 1, 'banners', '_MD_AM_BANNERS', '1', '_MD_AM_BANNERSDSC', 'yesno', 'int', 26)");
 167      $dbm->insert('config', " VALUES (13, 0, 1, 'debug_mode', '_MD_AM_DEBUGMODE', '0', '_MD_AM_DEBUGMODEDSC', 'select', 'int', 24)");
 168      $dbm->insert('config', " VALUES (14, 0, 1, 'my_ip', '_MD_AM_MYIP', '127.0.0.1', '_MD_AM_MYIPDSC', 'textbox', 'text', 29)");
 169      $dbm->insert('config', " VALUES (15, 0, 1, 'use_ssl', '_MD_AM_USESSL', '0', '_MD_AM_USESSLDSC', 'yesno', 'int', 30)");
 170      $dbm->insert('config', " VALUES (16, 0, 1, 'session_name', '_MD_AM_SESSNAME', 'xoops_session', '_MD_AM_SESSNAMEDSC', 'textbox', 'text', 20)");
 171      $dbm->insert('config', " VALUES (17, 0, 2, 'minpass', '_MD_AM_MINPASS', '5', '_MD_AM_MINPASSDSC', 'textbox', 'int', 1)");
 172      $dbm->insert('config', " VALUES (18, 0, 2, 'minuname', '_MD_AM_MINUNAME', '3', '_MD_AM_MINUNAMEDSC', 'textbox', 'int', 2)");
 173      $dbm->insert('config', " VALUES (19, 0, 2, 'new_user_notify', '_MD_AM_NEWUNOTIFY', '1', '_MD_AM_NEWUNOTIFYDSC', 'yesno', 'int', 4)");
 174      $dbm->insert('config', " VALUES (20, 0, 2, 'new_user_notify_group', '_MD_AM_NOTIFYTO', " . $gruops['XOOPS_GROUP_ADMIN'] . ", '_MD_AM_NOTIFYTODSC', 'group', 'int', 6)");
 175      $dbm->insert('config', " VALUES (21, 0, 2, 'activation_type', '_MD_AM_ACTVTYPE', '0', '_MD_AM_ACTVTYPEDSC', 'select', 'int', 8)");
 176      $dbm->insert('config', " VALUES (22, 0, 2, 'activation_group', '_MD_AM_ACTVGROUP', " . $gruops['XOOPS_GROUP_ADMIN'] . ", '_MD_AM_ACTVGROUPDSC', 'group', 'int', 10)");
 177      $dbm->insert('config', " VALUES (23, 0, 2, 'uname_test_level', '_MD_AM_UNAMELVL', '0', '_MD_AM_UNAMELVLDSC', 'select', 'int', 12)");
 178      $dbm->insert('config', " VALUES (24, 0, 2, 'avatar_allow_upload', '_MD_AM_AVATARALLOW', '0', '_MD_AM_AVATARALWDSC', 'yesno', 'int', 14)");
 179      $dbm->insert('config', " VALUES (27, 0, 2, 'avatar_width', '_MD_AM_AVATARW', '120', '_MD_AM_AVATARWDSC', 'textbox', 'int', 16)");
 180      $dbm->insert('config', " VALUES (28, 0, 2, 'avatar_height', '_MD_AM_AVATARH', '120', '_MD_AM_AVATARHDSC', 'textbox', 'int', 18)");
 181      $dbm->insert('config', " VALUES (29, 0, 2, 'avatar_maxsize', '_MD_AM_AVATARMAX', '35000', '_MD_AM_AVATARMAXDSC', 'textbox', 'int', 20)");
 182      $dbm->insert('config', " VALUES (30, 0, 1, 'adminmail', '_MD_AM_ADMINML', '" . addslashes($adminmail) . "', '_MD_AM_ADMINMLDSC', 'textbox', 'text', 3)");
 183      $dbm->insert('config', " VALUES (31, 0, 2, 'self_delete', '_MD_AM_SELFDELETE', '0', '_MD_AM_SELFDELETEDSC', 'yesno', 'int', 22)");
 184      $dbm->insert('config', " VALUES (32, 0, 1, 'com_mode', '_MD_AM_COMMODE', 'flat', '_MD_AM_COMMODEDSC', 'select', 'text', 34)");
 185      $dbm->insert('config', " VALUES (33, 0, 1, 'com_order', '_MD_AM_COMORDER', '0', '_MD_AM_COMORDERDSC', 'select', 'int', 36)");
 186      $dbm->insert('config', " VALUES (34, 0, 2, 'bad_unames', '_MD_AM_BADUNAMES', '" . addslashes(serialize(array('webmaster', '^xoops', '^admin'))) . "', '_MD_AM_BADUNAMESDSC', 'textarea', 'array', 24)");
 187      $dbm->insert('config', " VALUES (35, 0, 2, 'bad_emails', '_MD_AM_BADEMAILS', '" . addslashes(serialize(array('xoops.org$'))) . "', '_MD_AM_BADEMAILSDSC', 'textarea', 'array', 26)");
 188      $dbm->insert('config', " VALUES (36, 0, 2, 'maxuname', '_MD_AM_MAXUNAME', '10', '_MD_AM_MAXUNAMEDSC', 'textbox', 'int', 3)");
 189      $dbm->insert('config', " VALUES (37, 0, 1, 'bad_ips', '_MD_AM_BADIPS', '" . addslashes(serialize(array('127.0.0.1'))) . "', '_MD_AM_BADIPSDSC', 'textarea', 'array', 42)");
 190      $dbm->insert('config', " VALUES (38, 0, 3, 'meta_keywords', '_MD_AM_METAKEY', 'xoops, web applications, web 2.0, sns, news, technology, headlines, linux, software, download, downloads, free, community, forum, bulletin board, bbs, php, survey, polls, kernel, comment, comments, portal, odp, open source, opensource, FreeSoftware, gnu, gpl, license, Unix, *nix, mysql, sql, database, databases, web site, blog, wiki, module, modules, theme, themes, cms, content management', '_MD_AM_METAKEYDSC', 'textarea', 'text', 0)");
 191      $dbm->insert('config', " VALUES (39, 0, 3, 'footer', '_MD_AM_FOOTER', 'Powered by XOOPS &#169; 2001-" . date('Y', time()) . " <a href=\"http://xoops.sourceforge.net\" rel=\"external\" title=\"The XOOPS Project\">The XOOPS Project</a>', '_MD_AM_FOOTERDSC', 'textarea', 'text', 20)");
 192      $dbm->insert('config', " VALUES (40, 0, 4, 'censor_enable', '_MD_AM_DOCENSOR', '0', '_MD_AM_DOCENSORDSC', 'yesno', 'int', 0)");
 193      $dbm->insert('config', " VALUES (41, 0, 4, 'censor_words', '_MD_AM_CENSORWRD', '" . addslashes(serialize(array('fuck', 'shit'))) . "', '_MD_AM_CENSORWRDDSC', 'textarea', 'array', 1)");
 194      $dbm->insert('config', " VALUES (42, 0, 4, 'censor_replace', '_MD_AM_CENSORRPLC', '#OOPS#', '_MD_AM_CENSORRPLCDSC', 'textbox', 'text', 2)");
 195      $dbm->insert('config', " VALUES (43, 0, 3, 'meta_robots', '_MD_AM_METAROBOTS', 'index,follow', '_MD_AM_METAROBOTSDSC', 'select', 'text', 2)");
 196      $dbm->insert('config', " VALUES (44, 0, 5, 'enable_search', '_MD_AM_DOSEARCH', '1', '_MD_AM_DOSEARCHDSC', 'yesno', 'int', 0)");
 197      $dbm->insert('config', " VALUES (45, 0, 5, 'keyword_min', '_MD_AM_MINSEARCH', '5', '_MD_AM_MINSEARCHDSC', 'textbox', 'int', 1)");
 198      $dbm->insert('config', " VALUES (46, 0, 2, 'avatar_minposts', '_MD_AM_AVATARMP', '0', '_MD_AM_AVATARMPDSC', 'textbox', 'int', 15)");
 199      $dbm->insert('config', " VALUES (47, 0, 1, 'enable_badips', '_MD_AM_DOBADIPS', '0', '_MD_AM_DOBADIPSDSC', 'yesno', 'int', 40)");
 200      $dbm->insert('config', " VALUES (48, 0, 3, 'meta_rating', '_MD_AM_METARATING', 'general', '_MD_AM_METARATINGDSC', 'select', 'text', 4)");
 201      $dbm->insert('config', " VALUES (49, 0, 3, 'meta_author', '_MD_AM_METAAUTHOR', 'XOOPS', '_MD_AM_METAAUTHORDSC', 'textbox', 'text', 6)");
 202      $dbm->insert('config', " VALUES (50, 0, 3, 'meta_copyright', '_MD_AM_METACOPYR', 'Copyright  2001-" . date('Y', time()) . "', '_MD_AM_METACOPYRDSC', 'textbox', 'text', 8)");
 203      $dbm->insert('config', " VALUES (51, 0, 3, 'meta_description', '_MD_AM_METADESC', 'XOOPS is a dynamic Object Oriented based open source portal script written in PHP.', '_MD_AM_METADESCDSC', 'textarea', 'text', 1)");
 204      $dbm->insert('config', " VALUES (52, 0, 2, 'allow_chgmail', '_MD_AM_ALLWCHGMAIL', '0', '_MD_AM_ALLWCHGMAILDSC', 'yesno', 'int', 3)");
 205      $dbm->insert('config', " VALUES (53, 0, 1, 'use_mysession', '_MD_AM_USEMYSESS', '0', '_MD_AM_USEMYSESSDSC', 'yesno', 'int', 19)");
 206      $dbm->insert('config', " VALUES (54, 0, 2, 'reg_dispdsclmr', '_MD_AM_DSPDSCLMR', 1, '_MD_AM_DSPDSCLMRDSC', 'yesno', 'int', 30)");
 207      $dbm->insert('config', " VALUES (55, 0, 2, 'reg_disclaimer', '_MD_AM_REGDSCLMR', '" . addslashes(_INSTALL_DISCLMR) . "', '_MD_AM_REGDSCLMRDSC', 'textarea', 'text', 32)");
 208      $dbm->insert('config', " VALUES (56, 0, 2, 'allow_register', '_MD_AM_ALLOWREG', 1, '_MD_AM_ALLOWREGDSC', 'yesno', 'int', 0)");
 209      $dbm->insert('config', " VALUES (57, 0, 1, 'theme_fromfile', '_MD_AM_THEMEFILE', '0', '_MD_AM_THEMEFILEDSC', 'yesno', 'int', 13)");
 210      $dbm->insert('config', " VALUES (58, 0, 1, 'closesite', '_MD_AM_CLOSESITE', '0', '_MD_AM_CLOSESITEDSC', 'yesno', 'int', 26)");
 211      $dbm->insert('config', " VALUES (59, 0, 1, 'closesite_okgrp', '_MD_AM_CLOSESITEOK', '" . addslashes(serialize(array('1'))) . "', '_MD_AM_CLOSESITEOKDSC', 'group_multi', 'array', 27)");
 212      $dbm->insert('config', " VALUES (60, 0, 1, 'closesite_text', '_MD_AM_CLOSESITETXT', '" . _INSTALL_L165 . "', '_MD_AM_CLOSESITETXTDSC', 'textarea', 'text', 28)");
 213      $dbm->insert('config', " VALUES (61, 0, 1, 'sslpost_name', '_MD_AM_SSLPOST', 'xoops_ssl', '_MD_AM_SSLPOSTDSC', 'textbox', 'text', 31)");
 214      $dbm->insert('config', " VALUES (62, 0, 1, 'module_cache', '_MD_AM_MODCACHE', '', '_MD_AM_MODCACHEDSC', 'module_cache', 'array', 50)");
 215      $dbm->insert('config', " VALUES (63, 0, 1, 'template_set', '_MD_AM_DTPLSET', 'default', '_MD_AM_DTPLSETDSC', 'tplset', 'other', 14)");
 216  
 217      $dbm->insert('config', " VALUES (64,0,6,'mailmethod','_MD_AM_MAILERMETHOD','mail','_MD_AM_MAILERMETHODDESC','select','text',4)");
 218      $dbm->insert('config', " VALUES (65,0,6,'smtphost','_MD_AM_SMTPHOST','a:1:{i:0;s:0:\"\";}', '_MD_AM_SMTPHOSTDESC','textarea','array',6)");
 219      $dbm->insert('config', " VALUES (66,0,6,'smtpuser','_MD_AM_SMTPUSER','','_MD_AM_SMTPUSERDESC','textbox','text',7)");
 220      $dbm->insert('config', " VALUES (67,0,6,'smtppass','_MD_AM_SMTPPASS','','_MD_AM_SMTPPASSDESC','password','text',8)");
 221      $dbm->insert('config', " VALUES (68,0,6,'sendmailpath','_MD_AM_SENDMAILPATH','/usr/sbin/sendmail','_MD_AM_SENDMAILPATHDESC','textbox','text',5)");
 222      $dbm->insert('config', " VALUES (69,0,6,'from','_MD_AM_MAILFROM','','_MD_AM_MAILFROMDESC','textbox','text', 1)");
 223      $dbm->insert('config', " VALUES (70,0,6,'fromname','_MD_AM_MAILFROMNAME','','_MD_AM_MAILFROMNAMEDESC','textbox','text',2)");
 224      $dbm->insert('config', " VALUES (71, 0, 1, 'sslloginlink', '_MD_AM_SSLLINK', 'https://', '_MD_AM_SSLLINKDSC', 'textbox', 'text', 33)");
 225      $dbm->insert('config', " VALUES (72, 0, 1, 'theme_set_allowed', '_MD_AM_THEMEOK', '" . serialize(array('default')) . "', '_MD_AM_THEMEOKDSC', 'theme_multi', 'array', 13)");
 226      // RMV-NOTIFY... Need to specify which user is sender of notification PM

 227      $dbm->insert('config', " VALUES (73,0,6,'fromuid','_MD_AM_MAILFROMUID','1','_MD_AM_MAILFROMUIDDESC','user','int',3)");
 228  
 229      $dbm->insert('config', " VALUES (74,0,7,'auth_method','_MD_AM_AUTHMETHOD','xoops','_MD_AM_AUTHMETHODDESC','select','text',1)");
 230      $dbm->insert('config', " VALUES (75,0,7,'ldap_port','_MD_AM_LDAP_PORT','389','_MD_AM_LDAP_PORT','textbox','int',2)");
 231      $dbm->insert('config', " VALUES (76,0,7,'ldap_server','_MD_AM_LDAP_SERVER','your directory server','_MD_AM_LDAP_SERVER_DESC','textbox','text',3)");
 232      $dbm->insert('config', " VALUES (77,0,7,'ldap_base_dn','_MD_AM_LDAP_BASE_DN','dc=xoops,dc=org','_MD_AM_LDAP_BASE_DN_DESC','textbox','text',4)");
 233      $dbm->insert('config', " VALUES (78,0,7,'ldap_manager_dn','_MD_AM_LDAP_MANAGER_DN','manager_dn','_MD_AM_LDAP_MANAGER_DN_DESC','textbox','text',5)");
 234      $dbm->insert('config', " VALUES (79,0,7,'ldap_manager_pass','_MD_AM_LDAP_MANAGER_PASS','manager_pass','_MD_AM_LDAP_MANAGER_PASS_DESC','password','text',6)");
 235      $dbm->insert('config', " VALUES (80,0,7,'ldap_version','_MD_AM_LDAP_VERSION','3','_MD_AM_LDAP_VERSION_DESC','textbox','text', 7)");
 236      $dbm->insert('config', " VALUES (81,0,7,'ldap_users_bypass','_MD_AM_LDAP_USERS_BYPASS','" . serialize(array('admin')) . "','_MD_AM_LDAP_USERS_BYPASS_DESC','textarea','array',8)");
 237      $dbm->insert('config', " VALUES (82,0,7,'ldap_loginname_asdn','_MD_AM_LDAP_LOGINNAME_ASDN','uid_asdn','_MD_AM_LDAP_LOGINNAME_ASDN_D','yesno','int',9)");
 238      $dbm->insert('config', " VALUES (83,0,7,'ldap_loginldap_attr', '_MD_AM_LDAP_LOGINLDAP_ATTR', 'uid', '_MD_AM_LDAP_LOGINLDAP_ATTR_D', 'textbox', 'text', 10)");
 239      $dbm->insert('config', " VALUES (84,0,7,'ldap_filter_person','_MD_AM_LDAP_FILTER_PERSON','','_MD_AM_LDAP_FILTER_PERSON_DESC','textbox','text',11)");
 240      $dbm->insert('config', " VALUES (85,0,7,'ldap_domain_name','_MD_AM_LDAP_DOMAIN_NAME','mydomain','_MD_AM_LDAP_DOMAIN_NAME_DESC','textbox','text',12)");
 241      $dbm->insert('config', " VALUES (86,0,7,'ldap_provisionning','_MD_AM_LDAP_PROVIS','0','_MD_AM_LDAP_PROVIS_DESC','yesno','int',13)");
 242      $dbm->insert('config', " VALUES (87,0,7,'ldap_provisionning_group','_MD_AM_LDAP_PROVIS_GROUP','a:1:{i:0;s:1:\"2\";}','_MD_AM_LDAP_PROVIS_GROUP_DSC','group_multi','array',14)");
 243  
 244      $dbm->insert('config', " VALUES (88,0,7,'ldap_mail_attr','_MD_AM_LDAP_MAIL_ATTR','mail','_MD_AM_LDAP_MAIL_ATTR_DESC','textbox','text',15)");
 245      $dbm->insert('config', " VALUES (89,0,7,'ldap_givenname_attr','_MD_AM_LDAP_GIVENNAME_ATTR','givenname','_MD_AM_LDAP_GIVENNAME_ATTR_DSC','textbox','text',16)");
 246      $dbm->insert('config', " VALUES (90,0,7,'ldap_surname_attr','_MD_AM_LDAP_SURNAME_ATTR','sn','_MD_AM_LDAP_SURNAME_ATTR_DESC','textbox','text',17)");
 247      $dbm->insert('config', " VALUES (91,0,7,'ldap_field_mapping','_MD_AM_LDAP_FIELD_MAPPING_ATTR','email=mail|name=displayname','_MD_AM_LDAP_FIELD_MAPPING_DESC','textarea','text',18)");
 248      $dbm->insert('config', " VALUES (92,0,7,'ldap_provisionning_upd', '_MD_AM_LDAP_PROVIS_UPD', '1', '_MD_AM_LDAP_PROVIS_UPD_DESC', 'yesno', 'int', 19)");
 249      $dbm->insert('config', " VALUES (93,0,7,'ldap_use_TLS','_MD_AM_LDAP_USETLS','0','_MD_AM_LDAP_USETLS_DESC','yesno','int', 20)");
 250  
 251      $dbm->insert('config', " VALUES (94, 0, 1, 'cpanel', '_MD_AM_CPANEL', 'default', '_MD_AM_CPANELDSC', 'cpanel', 'other', 11)");
 252      $dbm->insert('config', " VALUES (95, 0, 2, 'welcome_type', '_MD_AM_WELCOMETYPE', '1', '_MD_AM_WELCOMETYPE_DESC', 'select', 'int', 3)");
 253  
 254      // Module System

 255      $dbm->insert('config', " VALUES (96, 1, 0, 'break1', '_MI_SYSTEM_PREFERENCE_BREAK_GENERAL', 'head', '', 'line_break', 'textbox', 0)");
 256      $dbm->insert('config', " VALUES (97, 1, 0, 'usetips', '_MI_SYSTEM_PREFERENCE_TIPS', '1', '_MI_SYSTEM_PREFERENCE_TIPS_DSC', 'yesno', 'int', 10)");
 257      $dbm->insert('config', " VALUES (98, 1, 0, 'typeicons', '_MI_SYSTEM_PREFERENCE_ICONS', 'default', '', 'select', 'text', 20)");
 258      $dbm->insert('config', " VALUES (99, 1, 0, 'typebreadcrumb', '_MI_SYSTEM_PREFERENCE_BREADCRUMB', 'default', '', 'select', 'text', 30)");
 259      $dbm->insert('config', " VALUES (100, 1, 0, 'break2', '_MI_SYSTEM_PREFERENCE_BREAK_ACTIVE', 'head', '', 'line_break', 'textbox', 40)");
 260      $dbm->insert('config', " VALUES (101, 1, 0, 'active_avatars', '_MI_SYSTEM_PREFERENCE_ACTIVE_AVATARS', '1', '', 'yesno', 'int', 50)");
 261      $dbm->insert('config', " VALUES (102, 1, 0, 'active_banners', '_MI_SYSTEM_PREFERENCE_ACTIVE_BANNERS', '1', '', 'yesno', 'int', 60)");
 262      $dbm->insert('config', " VALUES (103, 1, 0, 'active_blocksadmin', '_MI_SYSTEM_PREFERENCE_ACTIVE_BLOCKSADMIN', '1', '', 'hidden', 'int', 70)");
 263      $dbm->insert('config', " VALUES (104, 1, 0, 'active_comments', '_MI_SYSTEM_PREFERENCE_ACTIVE_COMMENTS', '1', '', 'yesno', 'int', 80)");
 264      $dbm->insert('config', " VALUES (105, 1, 0, 'active_filemanager', '_MI_SYSTEM_PREFERENCE_ACTIVE_FILEMANAGER', '1', '', 'yesno', 'int', 90)");
 265      $dbm->insert('config', " VALUES (106, 1, 0, 'active_groups', '_MI_SYSTEM_PREFERENCE_ACTIVE_GROUPS', '1', '', 'hidden', 'int', 100)");
 266      $dbm->insert('config', " VALUES (107, 1, 0, 'active_images', '_MI_SYSTEM_PREFERENCE_ACTIVE_IMAGES', '1', '', 'yesno', 'int', 110)");
 267      $dbm->insert('config', " VALUES (108, 1, 0, 'active_mailusers', '_MI_SYSTEM_PREFERENCE_ACTIVE_MAILUSERS', '1', '', 'yesno', 'int', 120)");
 268      $dbm->insert('config', " VALUES (109, 1, 0, 'active_modulesadmin', '_MI_SYSTEM_PREFERENCE_ACTIVE_MODULESADMIN', '1', '', 'hidden', 'int', 130)");
 269      $dbm->insert('config', " VALUES (110, 1, 0, 'active_maintenance', '_MI_SYSTEM_PREFERENCE_ACTIVE_MAINTENANCE', '1', '', 'yesno', 'int', 140)");
 270      $dbm->insert('config', " VALUES (111, 1, 0, 'active_preferences', '_MI_SYSTEM_PREFERENCE_ACTIVE_PREFERENCES', '1', '', 'hidden', 'int', 150)");
 271      $dbm->insert('config', " VALUES (112, 1, 0, 'active_smilies', '_MI_SYSTEM_PREFERENCE_ACTIVE_SMILIES', '1', '', 'yesno', 'int', 160)");
 272      $dbm->insert('config', " VALUES (113, 1, 0, 'active_tplsets', '_MI_SYSTEM_PREFERENCE_ACTIVE_TPLSETS', '1', '', 'hidden', 'int', 170)");
 273      $dbm->insert('config', " VALUES (114, 1, 0, 'active_userrank', '_MI_SYSTEM_PREFERENCE_ACTIVE_USERRANK', '1', '', 'yesno', 'int', 180)");
 274      $dbm->insert('config', " VALUES (115, 1, 0, 'active_users', '_MI_SYSTEM_PREFERENCE_ACTIVE_USERS', '1', '', 'yesno', 'int', 190)");
 275      $dbm->insert('config', " VALUES (116, 1, 0, 'break3', '_MI_SYSTEM_PREFERENCE_BREAK_PAGER', 'head', '', 'line_break', 'textbox', 200)");
 276      $dbm->insert('config', " VALUES (117, 1, 0, 'avatars_pager', '_MI_SYSTEM_PREFERENCE_AVATARS_PAGER', '10', '', 'textbox', 'int', 210)");
 277      $dbm->insert('config', " VALUES (118, 1, 0, 'banners_pager', '_MI_SYSTEM_PREFERENCE_BANNERS_PAGER', '10', '', 'textbox', 'int', 220)");
 278      $dbm->insert('config', " VALUES (119, 1, 0, 'comments_pager', '_MI_SYSTEM_PREFERENCE_COMMENTS_PAGER', '20', '', 'textbox', 'int', 230)");
 279      $dbm->insert('config', " VALUES (120, 1, 0, 'groups_pager', '_MI_SYSTEM_PREFERENCE_GROUPS_PAGER', '15', '', 'textbox', 'int', 240)");
 280      $dbm->insert('config', " VALUES (121, 1, 0, 'images_pager', '_MI_SYSTEM_PREFERENCE_IMAGES_PAGER', '15', '', 'textbox', 'int', 250)");
 281      $dbm->insert('config', " VALUES (122, 1, 0, 'smilies_pager', '_MI_SYSTEM_PREFERENCE_SMILIES_PAGER', '20', '', 'textbox', 'int', 260)");
 282      $dbm->insert('config', " VALUES (123, 1, 0, 'userranks_pager', '_MI_SYSTEM_PREFERENCE_USERRANKS_PAGER', '20', '', 'textbox', 'int', 270)");
 283      $dbm->insert('config', " VALUES (124, 1, 0, 'users_pager', '_MI_SYSTEM_PREFERENCE_USERS_PAGER', '20', '', 'textbox', 'int', 280)");
 284      $dbm->insert('config', " VALUES (125, 1, 0, 'break4', '_MI_SYSTEM_PREFERENCE_BREAK_EDITOR', 'head', '', 'line_break', 'textbox', 290)");
 285      $dbm->insert('config', " VALUES (126, 1, 0, 'blocks_editor', '_MI_SYSTEM_PREFERENCE_BLOCKS_EDITOR', 'dhtmltextarea', '_MI_SYSTEM_PREFERENCE_BLOCKS_EDITOR_DSC', 'select', 'text', 300)");
 286      $dbm->insert('config', " VALUES (127, 1, 0, 'comments_editor', '_MI_SYSTEM_PREFERENCE_COMMENTS_EDITOR', 'dhtmltextarea', '_MI_SYSTEM_PREFERENCE_COMMENTS_EDITOR_DSC', 'select', 'text', 310)");
 287      $dbm->insert('config', " VALUES (128, 1, 0, 'general_editor', '_MI_SYSTEM_PREFERENCE_GENERAL_EDITOR', 'dhtmltextarea', '_MI_SYSTEM_PREFERENCE_GENERAL_EDITOR_DSC', 'select', 'text', 320)");
 288      $dbm->insert('config', " VALUES (129, 1, 0, 'redirect', '_MI_SYSTEM_PREFERENCE_REDIRECT', 'admin.php?fct=preferences', '', 'hidden', 'text', 330)");
 289      $dbm->insert('config', " VALUES (130, 1, 0, 'com_anonpost', '_MI_SYSTEM_PREFERENCE_ANONPOST', '', '', 'hidden', 'text', 340)");
 290      $dbm->insert('config', " VALUES (133, 1, 0, 'jquery_theme', '_MI_SYSTEM_PREFERENCE_JQUERY_THEME', 'base', '', 'select', 'text', 35)");
 291  
 292      $dbm->insert('config', " VALUES (134, 0, 1, 'redirect_message_ajax', '_MD_AM_CUSTOM_REDIRECT', '1', '_MD_AM_CUSTOM_REDIRECT_DESC', 'yesno', 'int', 12)");
 293  
 294      require_once  '../class/xoopslists.php';
 295      $editors = XoopsLists::getDirListAsArray( '../class/xoopseditor' );
 296      $conf=35;
 297      foreach ( $editors as $dir ) {
 298          $dbm->insert('configoption', " VALUES (".$conf.", '".$dir."', '".$dir."', 126)");
 299          $conf++;
 300      }
 301      foreach ( $editors as $dir ) {
 302          $dbm->insert('configoption', " VALUES (".$conf.", '".$dir."', '".$dir."', 127)");
 303          $conf++;
 304      }
 305      foreach ( $editors as $dir ) {
 306          $dbm->insert('configoption', " VALUES (".$conf.", '".$dir."', '".$dir."', 128)");
 307          $conf++;
 308      }
 309      $icons = XoopsLists::getDirListAsArray('../modules/system/images/icons');
 310      foreach ( $icons as $dir ) {
 311          $dbm->insert('configoption', " VALUES (".$conf.", '".$dir."', '".$dir."', 98)");
 312          $conf++;
 313      }
 314      $breadcrumb = XoopsLists::getDirListAsArray('../modules/system/images/breadcrumb');
 315      foreach ( $breadcrumb as $dir ) {
 316          $dbm->insert('configoption', " VALUES (".$conf.", '".$dir."', '".$dir."', 99)");
 317          $conf++;
 318      }
 319      $jqueryui = XoopsLists::getDirListAsArray('../modules/system/css/ui');
 320      foreach ( $jqueryui as $dir ) {
 321          $dbm->insert('configoption', " VALUES (".$conf.", '".$dir."', '".$dir."', 133)");
 322          $conf++;
 323      }
 324      
 325      return $gruops;
 326  }
 327  
 328  function write_key() {
 329      set_time_limit(180);
 330      return xoPutLicenseKey(xoBuildLicenceKey(), XOOPS_ROOT_PATH . '/include/license.php', dirname(__FILE__) . '/license.dist.php');
 331  }
 332  
 333  ?>

title

Description

title

Description

title

Description

title

title

Body