Exemplo n.º 1
0
										<th></th>
									</tr>
									<?php 
    }
    foreach ($plugins as $extension) {
        $option_interface = NULL;
        $path = getPlugin($extension . '.php');
        $pluginStream = file_get_contents($path);
        if ($str = isolate('$plugin_description', $pluginStream)) {
            if (false === eval($str)) {
                $plugin_description = '';
            }
        } else {
            $plugin_description = '';
        }
        $str = isolate('$option_interface', $pluginStream);
        if (false !== $str) {
            require_once $path;
            if (preg_match('/\\s*=\\s*new\\s(.*)\\(/i', $str)) {
                eval($str);
                $warn = gettext('<strong>Note:</strong> Instantiating the option interface within the plugin may cause performance issues. You should instead set <code>$option_interface</code> to the name of the class as a string.');
            } else {
                eval($str);
                $option_interface = new $option_interface();
                $warn = '';
            }
        }
        if (!empty($option_interface)) {
            $_zp_plugin_count++;
            ?>
										<!-- <?php 
Exemplo n.º 2
0
/**
 * Figures out which plugin tabs to display
 */
function getPluginTabs()
{
    if (isset($_GET['tab'])) {
        $default = sanitize($_GET['tab']);
    } else {
        $default = 'all';
    }
    $paths = getPluginFiles('*.php');
    $classXlate = array('all' => gettext('all'), 'thirdparty' => gettext('3rd party'), 'enabled' => gettext('enabled'), 'admin' => gettext('admin'), 'demo' => gettext('demo'), 'development' => gettext('development'), 'feed' => gettext('feed'), 'mail' => gettext('mail'), 'media' => gettext('media'), 'misc' => gettext('misc'), 'spam' => gettext('spam'), 'seo' => gettext('seo'), 'uploader' => gettext('uploader'), 'users' => gettext('users'));
    zp_apply_filter('plugin_tabs', $classXlate);
    $classes = $member = $thirdparty = array();
    foreach ($paths as $plugin => $path) {
        $p = file_get_contents($path);
        $key = 'misc';
        if ($str = isolate('@subpackage', $p)) {
            preg_match('|@subpackage\\s+(.*)\\s|', $str, $matches);
            if (isset($matches[1])) {
                $key = strtolower(trim($matches[1]));
            }
        }
        $classes[$key][] = $plugin;
        if (extensionEnabled($plugin)) {
            $active[$plugin] = $path;
        }
        if (strpos($path, SERVERPATH . '/' . USER_PLUGIN_FOLDER) === 0) {
            if ($str = isolate('@category', $p)) {
                preg_match('|@category\\s+(.*)\\s|', $str, $matches);
                $deprecate = !isset($matches[1]) || $matches[1] != 'package';
            } else {
                $deprecate = true;
            }
            if ($deprecate) {
                $thirdparty[$plugin] = $path;
            }
        }
        if (array_key_exists($key, $classXlate)) {
            $local = $classXlate[$key];
        } else {
            $local = $classXlate[$key] = $key;
        }
        $member[$plugin] = $local;
    }
    ksort($classes);
    $tabs[$classXlate['all']] = 'admin-plugins.php?page=plugins&tab=all';
    if (!empty($thirdparty)) {
        $tabs[$classXlate['thirdparty']] = 'admin-plugins.php?page=plugins&tab=thirdparty';
    }
    if (!empty($active)) {
        $tabs[$classXlate['enabled']] = 'admin-plugins.php?page=plugins&tab=active';
    }
    switch ($default) {
        case 'all':
            $currentlist = array_keys($paths);
            break;
        case 'active':
            $currentlist = array_keys($active);
            break;
        case 'thirdparty':
            $currentlist = array_keys($thirdparty);
            break;
        default:
            $currentlist = array();
            break;
    }
    foreach ($classes as $class => $list) {
        $tabs[$classXlate[$class]] = 'admin-plugins.php?page=plugins&tab=' . $class;
        if ($class == $default) {
            $currentlist = $list;
        }
    }
    return array($tabs, $default, $currentlist, $paths, $member);
}
Exemplo n.º 3
0
     case 3:
         $enable = true;
         break;
 }
 if ($enable) {
     $pluginStream = file_get_contents($paths[$extension]);
     if ($setting != 2) {
         if ($str = isolate('$plugin_disable', $pluginStream)) {
             eval($str);
             if ($plugin_disable) {
                 continue;
             }
         }
     }
     $plugin_is_filter = 1 | THEME_PLUGIN;
     if ($str = isolate('$plugin_is_filter', $pluginStream)) {
         eval($str);
         if ($plugin_is_filter < THEME_PLUGIN) {
             if ($plugin_is_filter < 0) {
                 $plugin_is_filter = abs($plugin_is_filter) | THEME_PLUGIN | ADMIN_PLUGIN;
             } else {
                 if ($plugin_is_filter == 1) {
                     $plugin_is_filter = 1 | THEME_PLUGIN;
                 } else {
                     $plugin_is_filter = $plugin_is_filter | CLASS_PLUGIN;
                 }
             }
         }
     }
     setOption($opt, $plugin_is_filter);
     require_once $paths[$extension];
Exemplo n.º 4
0
            $button_alt = '';
            $button_hidden = '';
            $button_action = UTILITIES_FOLDER . '/' . $utility;
            $button_rights = false;
            $button_enable = true;
            $button_XSRFTag = '';
            $utilityStream = file_get_contents($utility);
            eval(isolate('$button_text', $utilityStream));
            eval(isolate('$button_hint', $utilityStream));
            eval(isolate('$button_icon', $utilityStream));
            eval(isolate('$button_rights', $utilityStream));
            eval(isolate('$button_alt', $utilityStream));
            eval(isolate('$button_hidden', $utilityStream));
            eval(isolate('$button_action', $utilityStream));
            eval(isolate('$button_enable', $utilityStream));
            eval(isolate('$button_XSRFTag', $utilityStream));
            $buttonlist[] = array('XSRFTag' => $button_XSRFTag, 'enable' => $button_enable, 'button_text' => $button_text, 'formname' => $utility, 'action' => $button_action, 'icon' => $button_icon, 'title' => $button_hint, 'alt' => $button_alt, 'hidden' => $button_hidden, 'rights' => $button_rights | ADMIN_RIGHTS);
        }
        $buttonlist = zp_apply_filter('admin_utilities_buttons', $buttonlist);
        $buttonlist = sortMultiArray($buttonlist, 'button_text', false);
        $count = 0;
        foreach ($buttonlist as $key => $button) {
            if (zp_loggedin($button['rights'])) {
                $count++;
            } else {
                unset($buttonlist[$key]);
            }
        }
        $count = round($count / 2);
        ?>
	<div class="box" id="overview-utility">
Exemplo n.º 5
0
</h2>
<?php 
    $curdir = getcwd();
    chdir(SERVERPATH . "/" . ZENFOLDER . UTILITIES_FOLDER);
    $filelist = safe_glob('*' . 'php');
    natcasesort($filelist);
    foreach ($filelist as $utility) {
        $button_text = '';
        $button_hint = '';
        $button_icon = '';
        $button_rights = false;
        $utilityStream = file_get_contents($utility);
        eval(isolate('$button_text', $utilityStream));
        eval(isolate('$button_hint', $utilityStream));
        eval(isolate('$button_icon', $utilityStream));
        eval(isolate('$button_rights', $utilityStream));
        $buttonlist[$button_text] = array('formname' => $utility, 'action' => 'utilities/' . $utility, 'icon' => $button_icon, 'title' => $button_hint, 'alt' => '', 'hidden' => '', 'rights' => $button_rights | ADMIN_RIGHTS);
    }
    ksort($buttonlist);
    $count = 0;
    foreach ($buttonlist as $name => $button) {
        if (zp_loggedin($button['rights'])) {
            $count++;
        } else {
            unset($buttonlist[$name]);
        }
    }
    $count = round($count / 2);
    ?>
	<div id="overview-maint_l">
	<?php 
    require_once SERVERPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER . '/cacheManager.php';
    $priority = $plugin_is_filter & PLUGIN_PRIORITY . ' | CLASS_PLUGIN';
    setupLog(sprintf(gettext('Plugin:%s enabled (%2$s)'), 'cacheManager', $priority), TEST_RELEASE);
    new cacheManager();
    setupLog(sprintf(gettext('Plugin:%1$s option interface instantiated (%2$s)'), 'cacheManager', $option_interface), TEST_RELEASE);
    list($usec, $sec) = explode(" ", microtime());
    $last = (double) $usec + (double) $sec;
    setupLog(sprintf(gettext('Plugin:%1$s setup completed in %2$.4f seconds'), 'cacheManager', $last - $start));
}
natcasesort($plugins);
echo gettext('Plugin setup:') . '<br />';
foreach ($plugins as $key => $extension) {
    $path = getPlugin($extension . '.php');
    if (strpos($path, SERVERPATH . '/' . USER_PLUGIN_FOLDER) === 0) {
        $pluginStream = file_get_contents($path);
        if ($str = isolate('@category', $pluginStream)) {
            preg_match('|@category\\s+(.*)\\s|', $str, $matches);
            if (!isset($matches[1]) || $matches[1] != 'package') {
                $deprecate = true;
            }
        } else {
            $deprecate = true;
        }
    }
    ?>
		<span>
			<img src="<?php 
    echo FULLWEBPATH . '/' . ZENFOLDER . '/setup/setup_pluginOptions.php?plugin=' . $extension . $debug;
    ?>
&from=<?php 
    echo $from;
Exemplo n.º 7
0
 } else {
     if (false === eval($str)) {
         $parserr = $parserr | 4;
         $plugin_version = ' ' . gettext('<strong>Error parsing <em>plugin_version</em> string!</strong> Try removing semicolons from string.');
     }
 }
 $str = isolate('$plugin_URL', $pluginStream);
 if (false === $str) {
     $plugin_URL = '';
 } else {
     if (false === eval($str)) {
         $parserr = $parserr | 8;
         $plugin_URL = gettext('<strong>Error parsing <em>plugin_URL</em> string!</strong> Try removing semicolons from string.');
     }
 }
 $str = isolate('$plugin_disable', $pluginStream);
 if (false === $str) {
     $plugin_disable = false;
 } else {
     if (false === eval($str)) {
         $parserr = $parserr | 8;
         $plugin_URL = gettext('<strong>Error parsing <em>plugin_disable</em> string!</strong> Try removing semicolons from string.');
     } else {
         if ($plugin_disable) {
             setOption($opt, 0);
         }
     }
 }
 echo "<tr>";
 echo '<td width="30%">';
 echo '<input type="checkbox" name="' . $opt . '" value="1"';
Exemplo n.º 8
0
                $plugin_is_filter = abs($plugin_is_filter) | THEME_PLUGIN | ADMIN_PLUGIN;
            } else {
                if ($plugin_is_filter == 1) {
                    $plugin_is_filter = 1 | THEME_PLUGIN;
                } else {
                    $plugin_is_filter = $plugin_is_filter | CLASS_PLUGIN;
                }
            }
        }
        if ($currentsetting && $currentsetting != $plugin_is_filter) {
            setOption($opt, $plugin_is_filter);
            //	the script has changed its setting!
        }
    }
    $optionlink = isolate('$option_interface', $pluginStream);
    if ($optionlink = isolate('$option_interface', $pluginStream)) {
        $optionlink = FULLWEBPATH . '/' . ZENFOLDER . '/admin-options.php?page=options&amp;tab=plugin&amp;show-' . $extension . '#' . $extension;
    } else {
        $optionlink = NULL;
    }
    ?>
	<tr>
		<td width="30%">
		<label>
			<input type="checkbox" name="<?php 
    echo $opt;
    ?>
" value="<?php 
    echo $plugin_is_filter;
    ?>
"