Exemplo n.º 1
0
 /**
  * @param string $className
  */
 public function loadClass(string $className)
 {
     if ($filename = $this->generator->checkClass($className)) {
         includeFile($filename);
         return true;
     }
 }
Exemplo n.º 2
0
 /**
  * Test the export and import admin functionality
  * @runInSeparateProcess
  */
 function testExport()
 {
     global $wbMessageBuffer;
     $this->SessionStart();
     includeFile('admin/admin_port.php');
     $admin_port = new admin_port();
     //create an export
     $_POST = array();
     foreach ($admin_port->export_fields as $key => $info) {
         $_POST[$key] = 'on';
     }
     $_POST['compression'] = 'zip';
     $exported = $admin_port->DoExport();
     self::AssertTrue($exported, 'Export Failed');
     //restore the archive
     $admin_port->SetExported();
     $archive = current($admin_port->exported);
     $_REQUEST = array('archive' => $archive);
     $_POST = array('cmd' => 'revert_confirmed');
     $reverted = $admin_port->Revert('revert_confirmed');
     echo implode("\n\n", $wbMessageBuffer);
     self::AssertTrue($reverted, 'Revert Failed');
     //clean up
     $_POST = array('old_folder' => array_values($admin_port->extra_dirs));
     $admin_port->RevertClean();
     $this->SessionEnd();
 }
Exemplo n.º 3
0
 /**
  * Return the html of a recaptcha area for use in a  <form>
  * @static
  * @return string
  */
 static function GetForm()
 {
     global $config, $dataDir;
     $html = '';
     if (gp_recaptcha::hasRecaptcha()) {
         includeFile('thirdparty/recaptchalib.php');
         $themes = array('red', 'white', 'blackglass', 'clean');
         $theme = 'clean';
         $lang = $config['recaptcha_language'];
         if ($lang == 'inherit') {
             $lang = $config['language'];
         }
         $recaptchaLangs['en'] = true;
         $recaptchaLangs['nl'] = true;
         $recaptchaLangs['fr'] = true;
         $recaptchaLangs['de'] = true;
         $recaptchaLangs['pt'] = true;
         $recaptchaLangs['ru'] = true;
         $recaptchaLangs['es'] = true;
         $recaptchaLangs['tr'] = true;
         if (isset($recaptchaLangs[$lang])) {
             $html .= '<script type="text/javascript">var RecaptchaOptions = { lang : "' . $lang . '", theme:"' . $theme . '" };</script>';
         }
         $html .= recaptcha_get_html($config['recaptcha_public']);
     }
     return gpPlugin::Filter('AntiSpam_Form', array($html));
 }
Exemplo n.º 4
0
 /**
  * Save changes made to an existing user's permissions
  *
  */
 function SaveChanges()
 {
     global $langmessage, $gpAdmin;
     $username =& $_REQUEST['username'];
     if (!isset($this->users[$username])) {
         message($langmessage['OOPS']);
         return false;
     }
     if (!empty($_POST['email'])) {
         $this->users[$username]['email'] = $_POST['email'];
     }
     $this->users[$username]['granted'] = $this->GetPostedPermissions($username);
     $this->users[$username]['editing'] = $this->GetEditingPermissions();
     //this needs to happen before SaveUserFile();
     //update the /_session file
     includeFile('tool/sessions.php');
     $userinfo =& $this->users[$username];
     $userinfo = gpsession::SetSessionFileName($userinfo, $username);
     //make sure $userinfo['file_name'] is set
     if (!$this->SaveUserFile()) {
         message($langmessage['OOPS']);
         return false;
     }
     // update the $user_file_name file
     $is_curr_user = $gpAdmin['username'] == $username;
     $this->UserFileDetails($username, $is_curr_user);
     return true;
 }
Exemplo n.º 5
0
 protected function loadClass($class)
 {
     if (isset($this->classMap[$class])) {
         return includeFile($this->classMap[$class]);
     } elseif (isset($this->classMap['\\' . $class])) {
         return includeFile($this->classMap['\\' . $class]);
     }
 }
Exemplo n.º 6
0
 /**
  * Loads the given class or interface.
  *
  * @param   string  $class  The name of the class
  *
  * @return  bool|null True if loaded, null otherwise
  *
  * @since   3.4
  */
 public function loadClass($class)
 {
     if ($file = $this->findFile($class)) {
         includeFile($file);
         \JLoader::applyAliasFor($class);
         return true;
     }
 }
Exemplo n.º 7
0
 /**
  * Very rough integration test of the updater
  * Passes if no errors are thrown
  * Also defines $page for subsequent tests
  *
  */
 function UpdateOutputTest()
 {
     global $page;
     ob_start();
     $page = new \gp\admin\Update();
     \gp\tool\Output::HeadContent();
     includeFile('install/template.php');
     ob_get_clean();
 }
Exemplo n.º 8
0
 /**
  * Very rough integration test of the updater
  * Passes if no errors are thrown
  * Also defines $page for subsequent tests
  *
  */
 function UpdateOutputTest()
 {
     global $page;
     ob_start();
     includeFile('tool/update.php');
     $page = new update_class();
     gpOutput::HeadContent();
     includeFile('install/template.php');
     ob_get_clean();
 }
Exemplo n.º 9
0
 function _autoload($className)
 {
     $filesPath = array(BASEPATH . DIRECTORY_SEPARATOR . APPPATH . DIRECTORY_SEPARATOR . LIBRARYPATH . DIRECTORY_SEPARATOR . $className . '.php', BASEPATH . DIRECTORY_SEPARATOR . APPPATH . DIRECTORY_SEPARATOR . MODELS . DIRECTORY_SEPARATOR . $className . '.php', BASEPATH . DIRECTORY_SEPARATOR . APPPATH . DIRECTORY_SEPARATOR . CONTROLLERS . DIRECTORY_SEPARATOR . $className . '.controller.php', BASEPATH . DIRECTORY_SEPARATOR . SYSTEMPATH . DIRECTORY_SEPARATOR . LIBRARYPATH . DIRECTORY_SEPARATOR . $className . '.php', BASEPATH . DIRECTORY_SEPARATOR . SYSTEMPATH . DIRECTORY_SEPARATOR . 'core' . DIRECTORY_SEPARATOR . $className . '.php', BASEPATH . DIRECTORY_SEPARATOR . SYSTEMPATH . DIRECTORY_SEPARATOR . 'database' . DIRECTORY_SEPARATOR . $className . '.php');
     foreach ($filesPath as $file) {
         if (file_exists($file)) {
             includeFile($file);
             break;
         }
     }
 }
Exemplo n.º 10
0
/**
*   includes the path to the dedicated class in the proper folder
*
*   @param string of class name
*/
function MyAutoload($file_name)
{
    $class_path = 'class/' . $file_name . '.php';
    if (file_exists($class_path)) {
        includeFile($class_path);
        echo '<!--' . $class_path . ' loaded with success' . '-->';
    } else {
        echo $file_name . ' not found!';
    }
}
Exemplo n.º 11
0
 public function __construct($file)
 {
     global $dataDir;
     includeFile('thirdparty/cssmin_v.1.0.php');
     $this->file = $file;
     $this->full_path = $dataDir . $file;
     $this->content = file_get_contents($this->full_path);
     $this->content = \cssmin::minify($this->content);
     $this->CSS_Import();
     $this->CSS_FixUrls();
 }
Exemplo n.º 12
0
 /**
  * Return the html of a recaptcha area for use in a  <form>
  * @static
  * @return string
  */
 public static function GetForm($theme = 'light')
 {
     global $config;
     $html = '';
     if (self::hasRecaptcha()) {
         includeFile('thirdparty/recaptcha/autoload.php');
         $html = '<script src="https://www.google.com/recaptcha/api.js" async defer></script>';
         $html .= '<div class="g-recaptcha" data-theme="' . $theme . '" data-sitekey="' . $config['recaptcha_public'] . '"></div>';
         //data-size="compact"
     }
     return \gp\tool\Plugins::Filter('AntiSpam_Form', array($html));
 }
Exemplo n.º 13
0
function includeDir($directory) {
	$list = scandir($directory);
	foreach ($list as $listItem) {
		if ($listItem[0] == ".") {
			continue;
		}
		if (is_dir($directory.$listItem)) {
			includeDir($directory.$listItem."/");
		} elseif (substr($listItem, strlen($listItem) - 3) == ".js") {
			includeFile($directory.$listItem);
		}
	}
}
Exemplo n.º 14
0
 function __construct()
 {
     global $dataDir, $langmessage;
     includeFile('tool/install.php');
     echo '<h2>' . $langmessage['Site Status'] . '</h2>';
     $check_dir = $dataDir . '/data';
     $this->check_dir_len = strlen($check_dir);
     $this->euid = '?';
     if (function_exists('posix_geteuid')) {
         $this->euid = posix_geteuid();
     }
     ob_start();
     $this->CheckDir($check_dir);
     $failed_output = ob_get_clean();
     $checked = $this->passed_count + $this->failed_count;
     if ($this->failed_count == 0) {
         echo '<p class="gp_passed">';
         echo sprintf($langmessage['data_check_passed'], $checked, $checked);
         echo '</p>';
         //$this->CheckPageFiles();
         return;
     }
     echo '<p class="gp_notice">';
     echo sprintf($langmessage['data_check_failed'], $this->failed_count, $checked);
     echo '</p>';
     if ($this->failed_count > $this->show_failed_max) {
         echo '<p class="gp_notice">';
         echo sprintf($langmessage['showing_max_failed'], $this->show_failed_max);
         echo '</p>';
     }
     echo '<table class="bordered">';
     echo '<tr><th>';
     echo $langmessage['file_name'];
     echo '</th><th colspan="2">';
     echo $langmessage['permissions'];
     echo '</th><th colspan="2">';
     echo $langmessage['File Owner'];
     echo '</th></tr>';
     echo '<tr><td>&nbsp;</td><td>';
     echo $langmessage['Current_Value'];
     echo '</td><td>';
     echo $langmessage['Expected_Value'];
     echo '</td><td>';
     echo $langmessage['Current_Value'];
     echo '</td><td>';
     echo $langmessage['Expected_Value'];
     echo '</td></tr>';
     echo $failed_output;
     echo '</table>';
     $this->CheckPageFiles();
 }
Exemplo n.º 15
0
function googleAutoload($class)
{
    $hasIncluded = false;
    $hasIncluded2 = false;
    $strClassPath = $class;
    // [className].php in basedir
    $hasIncluded = includeFile(dirname(__FILE__) . DIRECTORY_SEPARATOR . $class . ".php");
    if (empty($hasIncluded) and substr($strClassPath, 0, strlen("Google")) === 'Google') {
        $classFile = CLASSESDIR . DIRECTORY_SEPARATOR . str_replace("_", DIRECTORY_SEPARATOR, $strClassPath) . '.php';
        $hasIncluded = includeFile($classFile);
        if ($hasIncluded) {
            $hasIncluded2 = true;
        }
    }
    if (empty($hasIncluded)) {
        throw new InvalidArgumentException("autoloading of class {$class} impossible. Namespace syntax for classes seems to be wrong.");
    }
}
Exemplo n.º 16
0
 function InlineEdit()
 {
     $title = gp_edit::CleanTitle($_REQUEST['file']);
     if (empty($title)) {
         echo 'false';
         return false;
     }
     $data = array();
     $data['type'] = 'text';
     $data['content'] = '';
     $file = $this->folder . '/' . $title . '.php';
     $content = '';
     if (file_exists($file)) {
         ob_start();
         include $file;
         $data['content'] = ob_get_clean();
     }
     includeFile('tool/ajax.php');
     gpAjax::InlineEdit($data);
 }
Exemplo n.º 17
0
 /**
  * Update the gp_index, gp_titles and menus so that special pages can be renamed
  *
  */
 function Upgrade_234()
 {
     global $gp_index, $gp_titles, $gp_menu, $config, $dataDir;
     includeFile('tool/gpOutput.php');
     $special_indexes = array();
     $new_index = array();
     $new_titles = array();
     foreach ($gp_index as $title => $index) {
         $info = $gp_titles[$index];
         $type = common::SpecialOrAdmin($title);
         if ($type === 'special') {
             $special_indexes[$index] = strtolower($title);
             $index = strtolower($title);
             $info['type'] = 'special';
             //some older versions didn't maintain this value well
         }
         $new_index[$title] = $index;
         $new_titles[$index] = $info;
     }
     $gp_titles = $new_titles;
     $gp_index = $new_index;
     //update gp_menu
     $gp_menu = $this->FixMenu($gp_menu, $special_indexes);
     //save pages
     if (!admin_tools::SavePagesPHP()) {
         return;
     }
     $config['gpversion'] = '2.3.4';
     admin_tools::SaveConfig();
     //update alt menus
     if (isset($config['menus']) && is_array($config['menus'])) {
         foreach ($config['menus'] as $key => $value) {
             $menu_file = $dataDir . '/data/_menus/' . $key . '.php';
             if (gpFiles::Exists($menu_file)) {
                 $menu = gpOutput::GetMenuArray($key);
                 $menu = $this->FixMenu($menu, $special_indexes);
                 gpFiles::SaveData($menu_file, 'menu', $menu);
             }
         }
     }
 }
Exemplo n.º 18
0
 /**
  *
  * @runInSeparateProcess
  */
 function testInstall()
 {
     global $dataDir;
     //make sure it's not installed
     $config_file = $dataDir . '/data/_site/config.php';
     self::AssertFileNotExists($config_file, 'Cannot test installation (Already Installed)');
     //mimic POST
     $_POST = array();
     $_POST['email'] = '*****@*****.**';
     $_POST['username'] = '******';
     $_POST['password'] = '******';
     $_POST['password1'] = $_POST['password'];
     //attempt to install
     ob_start();
     includeFile('tool/install.php');
     $success = Install_Tools::Install_DataFiles_New();
     ob_get_clean();
     self::AssertTrue($success, 'Installation Failed');
     //double check
     self::AssertFileExists($config_file);
 }
Exemplo n.º 19
0
 protected function loadClass($class)
 {
     $classPath = str_replace(['\\', '_'], DIRECTORY_SEPARATOR, $class) . '.php';
     $findFile = function ($dir) use($classPath) {
         if (is_file($file = $this->normalizeDir($dir) . DIRECTORY_SEPARATOR . $classPath)) {
             return $file;
         }
     };
     foreach ($this->prefixes as $prefix => $dirs) {
         if (strpos($class, $this->normalizeNamespace($prefix)) === 0) {
             foreach ($dirs as $dir) {
                 if ($file = $findFile($dir)) {
                     return includeFile($file);
                 }
             }
         }
     }
     foreach ($this->fallbackDirs as $dir) {
         if ($file = $findFile($dir)) {
             return includeFile($file);
         }
     }
 }
Exemplo n.º 20
0
					<div class='col-sm-10'>
						<input type='email' id='email' class='form-control' name='email' value='<?php 
echo $email;
?>
' placeholder='Email'>
					</div>
				</div>

				<div class='form-group'>
					<label for='message' class='col-sm-2 control-label'>Message</label>

					<div class='col-sm-10'>
						<textarea id='message' class='form-control' name='message' rows='4' placeholder='Message...'><?php 
echo $msg;
?>
</textarea>
					</div>
				</div>

				<div class='form-group'>
					<div class='col-sm-offset-2 col-sm-10'>
						<input type='submit' class='btn btn-info' name='send' value='Send'>
					</div>
				</div>
			</form>
		</div>
	</div>

<?php 
includeFile('site/footer.php');
Exemplo n.º 21
0
 function SaveHeaderImage()
 {
     global $page, $dataDir, $dirPrefix, $langmessage;
     includeFile('tool/Images.php');
     $page->ajaxReplace = array();
     //source file
     $source_file_rel = $_REQUEST['file'];
     if (!empty($_REQUEST['src'])) {
         $source_file_rel = rawurldecode($_REQUEST['src']);
         if (!empty($dirPrefix)) {
             $len = strlen($dirPrefix);
             $source_file_rel = substr($source_file_rel, $len);
         }
     }
     $source_file_rel = '/' . ltrim($source_file_rel, '/');
     $source_file_full = $dataDir . $source_file_rel;
     if (!file_exists($source_file_full)) {
         message($langmessage['OOPS'] . ' (Source file not found)');
         return;
     }
     $src_img = thumbnail::getSrcImg($source_file_full);
     if (!$src_img) {
         message($langmessage['OOPS'] . ' (Couldn\'t create image [1])');
         return;
     }
     //size and position variables
     $orig_w = $width = imagesx($src_img);
     $orig_h = $height = imagesy($src_img);
     $posx = $posy = 0;
     if (isset($_REQUEST['posx']) && is_numeric($_REQUEST['posx'])) {
         $posx = $_REQUEST['posx'];
     }
     if (isset($_REQUEST['posy']) && is_numeric($_REQUEST['posy'])) {
         $posy = $_REQUEST['posy'];
     }
     if (isset($_REQUEST['width']) && is_numeric($_REQUEST['width'])) {
         $width = $_REQUEST['width'];
     }
     if (isset($_REQUEST['height']) && is_numeric($_REQUEST['height'])) {
         $height = $_REQUEST['height'];
     }
     //check to see if the image needs to be resized
     if ($posx == 0 && $posy == 0 && $width == $orig_w && $height == $orig_h) {
         $this->SetImage($source_file_rel, $width, $height);
         return;
     }
     //destination file
     $name = basename($source_file_rel);
     $parts = explode('.', $name);
     $type = array_pop($parts);
     if (count($parts) > 1) {
         $time_part = array_pop($parts);
         if (!ctype_digit($time_part)) {
             $parts[] = $time_part;
         }
     }
     $name = implode('.', $parts);
     $time = time();
     if (isset($_REQUEST['time']) && ctype_digit($_REQUEST['time'])) {
         $time = $_REQUEST['time'];
     }
     //$dest_img_rel = '/data/_uploaded/headers/'.$name.'.'.$time.'.'.$type;
     $dest_img_rel = '/data/_uploaded/headers/' . $name . '.' . $time . '.png';
     $dest_img_full = $dataDir . $dest_img_rel;
     //make sure the folder exists
     if (!gpFiles::CheckDir(dirname($dest_img_full))) {
         message($langmessage['OOPS'] . ' (Couldn\'t create directory)');
         return false;
     }
     if (!thumbnail::createImg($src_img, $dest_img_full, $posx, $posy, 0, 0, $orig_w, $orig_h, $orig_w, $orig_h, $width, $height)) {
         message($langmessage['OOPS'] . ' (Couldn\'t create image [2])');
         return;
     }
     if ($this->SetImage($dest_img_rel, $width, $height)) {
         includeFile('admin/admin_uploaded.php');
         admin_uploaded::CreateThumbnail($dest_img_full);
     }
 }
Exemplo n.º 22
0
<?php

/*
PHP script for Catalog Easy gpEasy Plugin
Author: a2exfr
http://my-sitelab.com/
Version 1.8
*/
defined('is_running') or die('Not an entry point...');
includeFile('tool/SectionContent.php');
if (version_compare(phpversion(), '5.4.0', '<')) {
    if (session_id() == '') {
        session_start();
    }
} else {
    if (session_status() == PHP_SESSION_NONE) {
        session_start();
    }
}
class Catalog_Easy
{
    public $flag_section;
    public $sect_options;
    public function __construct($flag_section = "no", $sect_options = "")
    {
        //for section settings
        $this->is_sect = $flag_section;
        if ($this->is_sect == "yes") {
            $this->sect_options = $sect_options;
        } else {
            $this->sect_options = "";
Exemplo n.º 23
0
<?php

defined('is_running') or die('Not an entry point...');
includeFile('tool/email_mailer.php');
class admin_configuration
{
    var $variables;
    //var $defaultVals = array();
    function __construct()
    {
        global $langmessage, $page;
        $page->ajaxReplace = array();
        //add examples to smtp_hosts
        $langmessage['about_config']['smtp_hosts'] .= 'ssl://smtp.gmail.com:465 ; tls://smtp.live.com:587';
        $langmessage['about_config']['showgplink'] = 'Showing the "powered by" link on your site is a great way to support gpEasy CMS.';
        $langmessage['about_config']['history_limit'] = 'Max: ' . gp_backup_limit;
        $langmessage['jquery'] = 'Google CDN';
        $this->variables = array('general_settings' => false, 'title' => '', 'keywords' => '', 'desc' => 'textarea', 'Interface' => false, 'colorbox_style' => array('example1' => 'Example 1', 'example2' => 'Example 2', 'example3' => 'Example 3', 'example4' => 'Example 4', 'example5' => 'Example 5'), 'language' => '', 'langeditor' => '', 'showsitemap' => 'boolean', 'showlogin' => 'boolean', 'showgplink' => 'boolean', 'Performance' => false, 'jquery' => '', 'maximgarea' => 'integer', 'maxthumbsize' => 'integer', 'auto_redir' => 'integer', 'history_limit' => 'integer', 'HTML_Tidy' => '', 'Report_Errors' => 'boolean', 'combinejs' => 'boolean', 'combinecss' => 'boolean', 'etag_headers' => 'boolean', 'resize_images' => 'boolean', 'space_char' => array('_' => 'Undersorce "_"', '-' => 'Dash "-"'), 'contact_config' => false, 'toemail' => '', 'toname' => '', 'from_address' => '', 'from_name' => '', 'from_use_user' => 'boolean', 'require_email' => '', 'contact_advanced' => false, 'mail_method' => '', 'sendmail_path' => '', 'smtp_hosts' => '', 'smtp_user' => '', 'smtp_pass' => 'password', 'reCaptcha' => false, 'recaptcha_public' => '', 'recaptcha_private' => '', 'recaptcha_language' => '');
        $cmd = common::GetCommand();
        switch ($cmd) {
            case 'save_config':
                $this->SaveConfig();
                break;
        }
        echo '<h2>' . $langmessage['configuration'] . '</h2>';
        $this->showForm();
    }
    function SaveConfig()
    {
        global $config, $langmessage;
        $possible = $this->variables;
Exemplo n.º 24
0
 /**
  * Loads the given class or interface.
  *
  * @param  string    $class The name of the class
  * @return bool|null True if loaded, null otherwise
  */
 public function loadClass($class)
 {
     if ($file = $this->findFile($class)) {
         includeFile($file);
         return true;
     }
     if (strpos($class, 'MY_') === 0) {
         if (file_exists(APPPATH . 'core/' . $class . EXT)) {
             @(include_once APPPATH . 'core/' . $class . EXT);
         }
     }
 }
Exemplo n.º 25
0
 * 			<input name=no_quotes>
 * 		Change "< " to "&lt; "
 *
 * Does Not:
 * 		Change poorly formatted html attributes
 * 		Fix self closing tags
 * 		Handle use of inline regular expressions in javascript
 *
 * 		(HTML_Output.php does fix some of these)
 *
 * To Do
 * 	Parse Error Handling
 *  	What to do with content after last tag?
 *
 */
includeFile('tool/HTML_Parse.php');
class gp_html_output extends gp_html_parse
{
    var $result = '';
    var $empty_attributes = array('checked' => 1, 'compact' => 1, 'declare' => 1, 'defer' => 1, 'disabled' => 1, 'ismap' => 1, 'multiple' => 1, 'nohref' => 1, 'noresize' => 1, 'noshade' => 1, 'nowrap' => 1, 'readonly' => 1, 'selected' => 1);
    var $self_closing_tags = array('img' => 1, 'input' => 1, 'area' => 1, 'br' => 1, 'hr' => 1, 'link' => 1);
    var $required_attr = array('area' => array('alt' => ''), 'bdo' => array('dir' => ''), 'form' => array('action' => ''), 'img' => array('src' => '', 'alt' => ''), 'map' => array('name' => ''), 'meta' => array('content' => ''), 'optgroup' => array('label' => ''), 'param' => array('name' => ''), 'script' => array('type' => 'text/javascript'), 'style' => array('type' => ''), 'textarea' => array('cols' => '', 'rows' => ''));
    function __construct($text)
    {
        parent::__construct($text);
        $this->dom_array = gpPlugin::Filter('Html_Output', array($this->dom_array));
        $this->Clean();
        $this->Rebuild();
    }
    /*
    * Make sure certain gpEasy elements aren't copied into the html of pages
Exemplo n.º 26
0
 /**
  * Get addon data from gpEasy.com and display to user
  *
  */
 function RemoteBrowse()
 {
     global $langmessage, $config, $dataDir, $gpversion;
     //search options
     if (isset($_GET['search_option'])) {
         $save = true;
         switch ($_GET['search_option']) {
             case 'version':
                 unset($config['search_version']);
                 break;
             case 'noversion':
                 $config['search_version'] = false;
                 break;
             default:
                 $save = false;
                 break;
         }
         if ($save) {
             admin_tools::SaveConfig();
         }
     }
     //make a list of installed addon id's
     $this->installed_ids = array();
     if (isset($config['addons']) && is_array($config['addons'])) {
         foreach ($config['addons'] as $addon_info) {
             if (isset($addon_info['id'])) {
                 $this->installed_ids[] = $addon_info['id'];
             }
         }
     }
     includeFile('tool/RemoteGet.php');
     $orderby = array();
     $orderby['rating_score'] = $langmessage['Highest Rated'];
     $orderby['downloads'] = $langmessage['Most Downloaded'];
     $orderby['modified'] = $langmessage['Recently Updated'];
     $orderby['created'] = $langmessage['Newest'];
     $_GET += array('q' => '');
     $this->searchPage = 0;
     if (isset($_REQUEST['page']) && ctype_digit($_REQUEST['page'])) {
         $this->searchPage = $_REQUEST['page'];
     }
     $this->searchQuery = 'cmd=remote';
     //version specific search
     $search_version = false;
     if (!isset($config['search_version']) || $config['search_version']) {
         $this->searchQuery .= '&ug=' . rawurlencode($gpversion);
         $search_version = true;
     }
     if (!empty($_GET['q'])) {
         $this->searchQuery .= '&q=' . rawurlencode($_GET['q']);
     }
     if (isset($_GET['order']) && isset($orderby[$_GET['order']])) {
         $this->searchOrder = $_GET['order'];
         $this->searchQuery .= '&order=' . rawurlencode($_GET['order']);
     } else {
         reset($orderby);
         $this->searchOrder = key($orderby);
     }
     $slug = 'Special_Addon_Plugins';
     if ($this->config_index == 'themes') {
         $slug = 'Special_Addon_Themes';
     }
     $src = $GLOBALS['addonBrowsePath'] . '/' . $slug . '?' . $this->searchQuery . '&page=' . $this->searchPage;
     //check cache
     $cache_file = $dataDir . '/data/_remote/' . sha1($src) . '.txt';
     $use_cache = false;
     if (file_exists($cache_file) && filemtime($cache_file) + 26100 > time()) {
         $result = file_get_contents($cache_file);
         $use_cache = true;
     } else {
         $result = gpRemoteGet::Get_Successful($src);
     }
     if (!$result) {
         echo '<p>' . $langmessage['Sorry, data not fetched'] . ' (f1)</p>';
         return;
     }
     if (strpos($result, 'a:') !== 0) {
         echo '<p>' . $langmessage['Sorry, data not fetched'] . ' (f2)</p>';
         return;
     }
     $data = unserialize($result);
     if (count($data) == 0) {
         echo '<p>' . $langmessage['Sorry, data not fetched'] . ' (f3)</p>';
         return;
     }
     //save the cache
     if (!$use_cache) {
         gpFiles::Save($cache_file, $result);
     }
     $this->searchMax = $data['max'];
     if (isset($data['per_page']) && $data['per_page']) {
         $this->searchPerPage = $data['per_page'];
     } else {
         $this->searchPerPage = count($data['rows']);
     }
     $this->searchOffset = $this->searchPage * $this->searchPerPage;
     $this->FindForm();
     echo '<h2 class="hmargin">';
     echo common::Link($this->browser_path, $this->manage_label);
     echo ' <span>|</span> ';
     if (!empty($_GET['q'])) {
         echo common::Link($this->browser_path, $this->find_label, 'cmd=remote');
         echo ' &#187; ';
         echo htmlspecialchars($_GET['q']);
     } else {
         echo $this->find_label;
     }
     echo '</h2>';
     echo '<div class="gp_search_options">';
     $this->SearchNavLinks();
     echo '<div class="search_order">';
     foreach ($orderby as $key => $label) {
         if ($key === $this->searchOrder) {
             echo '<span>' . $label . '</span>';
         } else {
             echo common::Link($this->browser_path, $label, $this->searchQuery . '&order=' . $key);
         }
     }
     echo '</div></div>';
     echo '<table class="bordered full_width">';
     echo '<tr><th></th><th>' . $langmessage['name'] . '</th><th>' . $langmessage['version'] . '</th><th>' . $langmessage['Statistics'] . '</th><th>' . $langmessage['description'] . '</th></tr>';
     $i = 0;
     if (count($data['rows'])) {
         foreach ($data['rows'] as $row) {
             echo '<tr class="' . ($i % 2 ? 'even' : '') . '">';
             echo '<td>';
             $this->DetailLink($row, '<img src="' . $row['icon'] . '" height="100" width="100" alt=""/>', '', ' class="shot"');
             echo '</td>';
             echo '<td class="nowrap">';
             echo '<b>' . $row['name'] . '</b>';
             echo '<br/>';
             $this->DetailLink($row);
             echo ' | ';
             $this->InstallLink($row);
             echo '</td><td>';
             echo $row['version'];
             echo '</td><td class="nowrap">';
             echo sprintf($langmessage['_downloads'], number_format($row['downloads']));
             echo '<br/>';
             $this->CurrentRating($row['rating_weighted']);
             echo '<br/>';
             echo $row['rating_count'] . ' ratings';
             echo '</td><td>';
             echo $row['short_description'];
             //echo showArray($row);
             echo '</td></tr>';
             $i++;
         }
         echo '</table>';
         $this->SearchNavLinks();
     } else {
         echo '</table>';
         echo '<p>' . $langmessage['Sorry, nothing matched'] . '</p>';
     }
     echo '<h3>Search Options</h3>';
     echo '<ul>';
     echo '<li>Limit results to addons that are compatible with your version of gpEasy (' . $gpversion . ') &nbsp; ';
     if ($search_version) {
         echo '<b>' . $langmessage['On'] . '</b> &nbsp; ';
         echo common::Link($this->browser_path, $langmessage['Off'], $this->searchQuery . '&search_option=noversion', ' name="gpajax"');
     } else {
         echo common::Link($this->browser_path, $langmessage['On'], $this->searchQuery . '&search_option=version', ' name="gpajax"');
         echo ' &nbsp;  <b>' . $langmessage['Off'] . '</b>';
     }
     echo '</li>';
     echo '</ul>';
 }
Exemplo n.º 27
0
 function RunScript()
 {
     if (!$this->SetVars()) {
         return;
     }
     //allow addons to effect page actions and how a page is displayed
     $cmd = common::GetCommand();
     $cmd_after = gpPlugin::Filter('PageRunScript', array($cmd));
     if ($cmd !== $cmd_after) {
         $cmd = $cmd_after;
         if ($cmd === 'return') {
             return;
         }
     }
     $this->GetFile();
     includeFile('tool/SectionContent.php');
     $this->contentBuffer = section_content::Render($this->file_sections, $this->title, $this->file_stats);
 }
Exemplo n.º 28
0
 /**
  * Stop loading
  * Check to see if the cms has already been installed
  *
  */
 public static function stop()
 {
     global $dataDir;
     if (!\gp\tool\Files::Exists($dataDir . '/data/_site/config.php')) {
         if (file_exists($dataDir . '/include/install/install.php')) {
             self::SetLinkPrefix();
             includeFile('install/install.php');
             die;
         }
     }
     die('<p>Notice: The site configuration did not load properly.</p>' . '<p>If you are the site administrator, you can troubleshoot the problem turning debugging "on" or bypass it by enabling ' . CMS_NAME . ' safe mode.</p>' . '<p>More information is available in the <a href="' . CMS_DOMAIN . '/Docs/Main/Troubleshooting">Documentation</a>.</p>' . self::ErrorBuffer(true, false));
 }
Exemplo n.º 29
0
 /**
  * Loads the given class or interface.
  *
  * @param  string    $class The name of the class
  * @return bool|null True if loaded, null otherwise
  */
 public function loadClass($class)
 {
     if ($file = $this->findFile($class)) {
         includeFile($file);
         return true;
     }
 }
Exemplo n.º 30
0
</head>

<body>
<div class="lside">
<?php 
includeFile("data/menu.html");
?>
</div>

<div class="center">
<?php 
includeFile("data/login.html");
?>

<h2>FIRST</h2>
<p><img alt="" src="images/logos/first.jpg" align="left" class="marbor" /> FIRST stands for "For Inspiration and Recognition of Science and Technology."  As its name implies, the organization aims to pormote the values of science and engineering in the world's youth.  <img alt="" src="images/kamen.jpg" align="right" class="marbor"/>Founded in 1989 by Dean Kamen, inventor of the segway human transporter and countless other machines and devices, FIRST has been holding Robotics Competition since 1992.  Each competition creates challenges that inspire student to work together to discover robotic solutions to these problems.
</p>
<br />

</div>

<div class="lside">
<center><?php 
includeFile("data/companies.html");
?>
</center>
</div>

</body>
</html>