Example #1
0
 function admin_permalinks()
 {
     global $langmessage, $dataDir;
     $this->htaccess_file = $dataDir . '/.htaccess';
     gp_filesystem_base::init($this->htaccess_file);
     echo '<h2>' . $langmessage['permalink_settings'] . '</h2>';
     $cmd = common::GetCommand();
     switch ($cmd) {
         case 'continue':
             $this->SaveHtaccess();
             break;
         default:
             $this->ShowForm();
             break;
     }
 }
 function __construct()
 {
     global $langmessage, $dataDir;
     $iis = self::IIS();
     if ($iis) {
         $this->rule_file_name = 'web.config';
     } else {
         $this->rule_file_name = '.htaccess';
     }
     $this->rule_file = $dataDir . '/' . $this->rule_file_name;
     gp_filesystem_base::init($this->rule_file);
     echo '<h2>' . $langmessage['permalink_settings'] . '</h2>';
     $cmd = common::GetCommand();
     switch ($cmd) {
         case 'continue':
             if (!$this->SaveHtaccess()) {
                 break;
             }
         default:
             $this->ShowForm();
             break;
     }
 }
Example #3
0
 /**
  * Prepare gp_filesystem for writing to $dataDir
  * $dataDir writability is required so that we can create a temporary directory next to /data for replacement
  *
  */
 function RevertFilesystem()
 {
     global $gp_filesystem, $dataDir, $langmessage;
     $context = array($dataDir => 'dir');
     gp_filesystem_base::init($context, 'list');
     if (!$gp_filesystem) {
         message($langmessage['OOPS'] . ' (No filesystem)');
         return false;
     }
     return true;
 }
Example #4
0
 /**
  * Get the minimum filesystem_method for $link
  * if the target of the symbolic link doesnt exist then is_writable($file) will return false
  * @static
  */
 static function get_filesystem_method_link($link)
 {
     $temp = gp_filesystem_base::TempFile($link);
     if (@rename($link, $temp)) {
         @rename($temp, $link);
         return gp_filesystem_direct;
     }
     if (function_exists('ftp_connect')) {
         return gp_filesystem_ftp;
     } else {
         return false;
     }
 }
Example #5
0
 /**
  * Determine how we'll be writing the new code to the server (ftp or direct)
  *
  */
 function DetectFileSystem()
 {
     global $dataDir, $gp_filesystem;
     //already determined
     if (isset($_POST['filesystem_method']) && gp_filesystem_base::set_method($_POST['filesystem_method'])) {
         return $_POST['filesystem_method'];
     }
     $this->curr_step = 1;
     //make sure we don't attempt anything beyond step 1
     $context[$dataDir] = 'file';
     // Need to be able to write to the dataDir
     $context[$dataDir . '/include'] = 'file';
     // Need to be able to rename or delete the include directory
     $context[$dataDir . '/themes'] = 'dir';
     // These may have user content in them and should not be completely replaced
     $context[$dataDir . '/addons'] = 'dir';
     gp_filesystem_base::init($context, 'list');
     if (!$gp_filesystem) {
         return false;
     }
     return $gp_filesystem->method;
 }
Example #6
0
 function DetectFileSystem()
 {
     global $dataDir;
     //Need to be able to write to the dataDir
     $context[$dataDir] = 'file';
     //Need to be able to rename or delete the include directory
     $context[$dataDir . '/include'] = 'file';
     //these may have user content in them and should not be completely replaced
     $context[$dataDir . '/themes'] = 'dir';
     $context[$dataDir . '/addons'] = 'dir';
     gp_filesystem_base::init($context, 'list');
 }