Example #1
0
             $user['id'] = $db->lastInsertId();
             $db->insert($db_x . 'groups_users', array('gru_userid' => (int) $user['id'], 'gru_groupid' => COT_GROUP_SUPERADMINS));
             $db->update($db_x . 'config', array('config_value' => $user['email']), "config_owner = 'core' AND config_name = 'adminemail'");
         } catch (PDOException $err) {
             cot_error(cot_rc('install_error_sql_script', array('msg' => $err->getMessage())));
         }
     }
     break;
 case 4:
     // Dependency check
     $install = true;
     foreach ($selected_modules as $ext) {
         $install &= cot_extension_dependencies_statisfied($ext, true, $selected_modules, $selected_plugins);
     }
     foreach ($selected_plugins as $ext) {
         $install &= cot_extension_dependencies_statisfied($ext, false, $selected_modules, $selected_plugins);
     }
     if ($install && !cot_error_found()) {
         // Load groups
         $cot_groups = array();
         $res = $db->query("SELECT grp_id FROM {$db_groups}\n\t\t\t\t\tWHERE grp_disabled=0 ORDER BY grp_level DESC");
         while ($row = $res->fetch()) {
             $cot_groups[$row['grp_id']] = array('id' => $row['grp_id'], 'alias' => $row['grp_alias'], 'level' => $row['grp_level'], 'disabled' => $row['grp_disabled'], 'hidden' => $row['grp_hidden'], 'state' => $row['grp_state'], 'name' => htmlspecialchars($row['grp_name']), 'title' => htmlspecialchars($row['grp_title']));
         }
         $res->closeCursor();
         $usr['id'] = 1;
         // Install all at once
         // Note: installation statuses are ignored in this installer
         $selected_modules = cot_install_sort_extensions($selected_modules, true);
         foreach ($selected_modules as $ext) {
             if (!cot_extension_install($ext, true)) {
Example #2
0
     $old_ext_format = false;
     $info = cot_infoget($ext_info, 'COT_EXT');
     if (!$info && cot_plugin_active('genoa')) {
         // Try to load old format info
         $info = cot_infoget($ext_info, 'SED_EXTPLUGIN');
         $old_ext_format = true;
         cot_message('ext_old_format', 'warning');
     }
 } else {
     $info = array('Name' => $code);
 }
 switch ($b) {
     case 'install':
         $installed_modules = $db->query("SELECT ct_code FROM {$db_core} WHERE ct_plug = 0")->fetchAll(PDO::FETCH_COLUMN);
         $installed_plugins = $db->query("SELECT ct_code FROM {$db_core} WHERE ct_plug = 1")->fetchAll(PDO::FETCH_COLUMN);
         $dependencies_satisfied = cot_extension_dependencies_statisfied($code, $is_module, $installed_modules, $installed_plugins);
         if ($dependencies_satisfied) {
             $result = cot_extension_install($code, $is_module);
         }
         break;
     case 'update':
         $result = cot_extension_install($code, $is_module, true, true);
         break;
     case 'uninstall':
         /* === Hook  === */
         foreach (cot_getextplugins('admin.extensions.uninstall.first') as $pl) {
             include $pl;
         }
         /* ===== */
         if (cot_check_xg(false)) {
             // Check if there are extensions installed depending on this one