Esempio n. 1
0
        } else {
            if ($ids = dimplode($_GET['delete'])) {
                C::t('common_admincp_cmenu')->delete($_GET['delete'], $_G['uid']);
            }
            if (is_array($_GET['titlenew'])) {
                foreach ($_GET['titlenew'] as $id => $title) {
                    $_GET['urlnew'][$id] = rawurlencode($_GET['urlnew'][$id]);
                    $title = dhtmlspecialchars($_GET['langnew'][$id] && cplang($_GET['langnew'][$id], false) ? $_GET['langnew'][$id] : $title);
                    $ordernew = intval($_GET['displayordernew'][$id]);
                    C::t('common_admincp_cmenu')->update($id, array('title' => $title, 'displayorder' => $ordernew, 'url' => dhtmlspecialchars($_GET['urlnew'][$id])));
                }
            }
            if (is_array($_GET['newtitle'])) {
                foreach ($_GET['newtitle'] as $k => $v) {
                    $_GET['urlnew'][$k] = rawurlencode($_GET['urlnew'][$k]);
                    C::t('common_admincp_cmenu')->insert(array('title' => dhtmlspecialchars($v), 'displayorder' => intval($_GET['newdisplayorder'][$k]), 'url' => dhtmlspecialchars($_GET['newurl'][$k]), 'sort' => 1, 'uid' => $_G['uid']));
                }
            }
            updatemenu('index');
            cpmsg('custommenu_edit_succeed', 'action=misc&operation=custommenu', 'succeed');
        }
    } elseif ($do == 'add') {
        if ($_GET['title'] && $_GET['url']) {
            admincustom($_GET['title'], dhtmlspecialchars($_GET['url']), 1);
            updatemenu('index');
            cpmsg('custommenu_add_succeed', rawurldecode($_GET['url']), 'succeed', array('title' => cplang($_GET['title'])));
        } else {
            cpmsg('parameters_error', '', 'error');
        }
    }
}
Esempio n. 2
0
        $settingnew = getgpc('settingnew');
        $enabled = false;
        foreach ($settingnew['verify'] as $key => $value) {
            if ($value['available'] && !$value['title']) {
                cpmsg('members_verify_title_invalid', '', 'error');
            }
            if ($value['available']) {
                $enabled = true;
            }
            $_G['setting']['verify'][$key]['available'] = intval($value['available']);
            $_G['setting']['verify'][$key]['title'] = $value['title'];
        }
        $_G['setting']['verify']['enabled'] = $enabled;
        C::t('common_setting')->update('verify', $_G['setting']['verify']);
        updatecache(array('setting'));
        updatemenu('user');
        cpmsg('members_verify_update_succeed', 'action=verify', 'succeed');
    }
}
function getverifyicon($iconkey = 'iconnew', $vid = 1, $extstr = 'verify_icon')
{
    global $_G, $_FILES;
    if ($_FILES[$iconkey]) {
        $data = array('extid' => "{$vid}");
        $iconnew = upload_icon_banner($data, $_FILES[$iconkey], $extstr);
    } else {
        $iconnew = $_GET['' . $iconkey];
    }
    return $iconnew;
}
function delverifyicon($icon)
Esempio n. 3
0
     }
     cpmsg('plugins_delete_confirm', 'action=plugins&operation=delete&pluginid=' . $pluginid . '&confirmed=yes', 'form', array('pluginname' => $plugin['name'], 'toversion' => $plugin['version']));
 } else {
     $identifier = $plugin['identifier'];
     DB::query("DELETE FROM " . DB::table('common_plugin') . " WHERE pluginid={$pluginid}");
     DB::query("DELETE FROM " . DB::table('common_pluginvar') . " WHERE pluginid={$pluginid}");
     DB::delete('common_nav', "type='3' AND identifier='{$identifier}'");
     foreach (array('script', 'template') as $type) {
         loadcache('pluginlanguage_' . $type, 1);
         if (isset($_G['cache']['pluginlanguage_' . $type][$identifier])) {
             unset($_G['cache']['pluginlanguage_' . $type][$identifier]);
             save_syscache('pluginlanguage_' . $type, $_G['cache']['pluginlanguage_' . $type]);
         }
     }
     updatecache(array('plugin', 'setting', 'styles'));
     updatemenu('plugin');
     if ($dir) {
         $file = DISCUZ_ROOT . './source/plugin/' . $dir . '/discuz_plugin_' . $dir . ($modules['extra']['installtype'] ? '_' . $modules['extra']['installtype'] : '') . '.xml';
         if (file_exists($file)) {
             $importtxt = @implode('', file($file));
             $pluginarray = getimportdata('Discuz! Plugin');
             if (!empty($pluginarray['uninstallfile']) && preg_match('/^[\\w\\.]+$/', $pluginarray['uninstallfile'])) {
                 dheader('location: ' . ADMINSCRIPT . '?action=plugins&operation=pluginuninstall&dir=' . $dir . '&installtype=' . $modules['extra']['installtype']);
             }
         }
     }
     loadcache('pluginlanguage_install', 1);
     if (isset($_G['cache']['pluginlanguage_install'][$identifier])) {
         unset($_G['cache']['pluginlanguage_install'][$identifier]);
         save_syscache('pluginlanguage_install', $_G['cache']['pluginlanguage_install']);
     }
Esempio n. 4
0
            }
            $filename = DISCUZ_ROOT . './source/plugin/' . $dir . '/' . $pluginarray['checkfile'];
            if (file_exists($filename)) {
                @(include $filename);
            }
        }
        showsubmenu($lang['plugins_config_uninstall'] . ' - ' . $plugin['name'] . ($plugin['available'] ? cplang('plugins_edit_available') : ''));
        echo '<div class="infobox">' . $addonstr . ($upgradestr ? '<h4 class="infotitle2">' . $lang['plugins_config_upgrade'] . '</h4>' . $upgradestr . '<br /><br />' : '') . ($deletestr ? '<h4 class="infotitle2">' . $lang['plugins_config_delete'] . '</h4>' . $deletestr . '<br /><br />' : '') . '<input class="btn" onclick="location.href=\'' . ADMINSCRIPT . '?action=plugins\'" type="button" value="' . $lang['cancel'] . '"/>
			</div>';
    } else {
        $identifier = $plugin['identifier'];
        DB::query("DELETE FROM " . DB::table('common_plugin') . " WHERE pluginid={$pluginid}");
        DB::query("DELETE FROM " . DB::table('common_pluginvar') . " WHERE pluginid={$pluginid}");
        DB::delete('common_nav', "type='3' AND identifier='{$identifier}'");
        updatecache(array('plugin', 'setting', 'styles'));
        updatemenu();
        if ($dir) {
            $dir = substr($dir, 0, -1);
            $pdir = DISCUZ_ROOT . './source/plugin/' . $dir;
            if (file_exists($pdir)) {
                $d = dir($pdir);
                while ($f = $d->read()) {
                    if (preg_match('/^discuz\\_plugin_' . $dir . '(\\_\\w+)?\\.xml$/', $f, $a)) {
                        $installtype = substr($a[1], 1);
                        $file = $pdir . '/' . $f;
                        $importtxt = @implode('', file($file));
                        $pluginarray = getimportdata('Discuz! Plugin');
                        if (!empty($pluginarray['uninstallfile']) && preg_match('/^[\\w\\.]+$/', $pluginarray['uninstallfile'])) {
                            dheader('location: ' . ADMINSCRIPT . '?action=plugins&operation=pluginuninstall&dir=' . $dir . '&installtype=' . $installtype);
                        }
                        break;