private static function createDirs(Module_Audit $module, $dropTable) { $dirname = GWF_WWW_PATH . 'dbimg'; if (false === GWF_File::createDir($dirname)) { return GWF_HTML::err('ERR_WRITE_FILE', array($dirname)); } $dirname = GWF_WWW_PATH . 'dbimg/sudosh'; if (false === GWF_File::createDir($dirname)) { return GWF_HTML::err('ERR_WRITE_FILE', array($dirname)); } if (false === GWF_HTAccess::protect($dirname)) { return GWF_HTML::err('ERR_WRITE_FILE', array($dirname . '.htaccess')); } return ''; }
private static function installDlDirs($module, $dropTable) { $dir = 'dbimg/dl'; if (is_dir($dir)) { if (false === GWF_HTAccess::protect($dir)) { return GWF_HTML::err('ERR_WRITE_FILE', array($dir . '/.htaccess')); } else { return ''; } } if (false === mkdir($dir) || false === chmod($dir, GWF_CHMOD)) { return GWF_HTML::err('ERR_WRITE_FILE', array($dir)); } if (false === GWF_HTAccess::protect($dir)) { return GWF_HTML::err('ERR_WRITE_FILE', array($dir . '/.htaccess')); } return ''; }
private static function installAttachments(Module_Forum $module) { # Create dir $dirname = 'dbimg/forum_attach'; if (is_dir($dirname) && is_readable($dirname)) { } elseif (false === @mkdir($dirname, GWF_CHMOD)) { return GWF_HTML::err('ERR_WRITE_FILE', $dirname); } # Protect it. if (false === GWF_HTAccess::protect($dirname)) { return GWF_HTML::err('ERR_WRITE_FILE', $dirname); } return ''; }
/** * Protect install folder. */ public static function wizard_11() { if (false !== ($error = self::wizard_check_cfg_quick())) { return $error; } $back = self::wizard_h2('11'); if (false === GWF_HTAccess::protect404(GWF_WWW_PATH . 'install')) { return $back . GWF_HTML::err('ERR_WRITE_FILE', array('install/.htaccess')); } $back .= sprintf('<p>%s</p>', self::$gwfil->lang('step_11_0')); $back .= sprintf('<p>%s</p>', self::$gwfil->lang('msg_all_done')); return $back; }
public static function installHTAccess2(array $modules) { $hta = GWF_HTAccess::getHTAccess(); foreach ($modules as $module) { $module instanceof GWF_Module; if (false === $module->isEnabled()) { continue; } $hta .= '# ' . $module->getName() . PHP_EOL; $methods = self::getAllMethods($module); foreach ($methods as $method) { $hta .= $method->getHTAccess(); } $hta .= PHP_EOL; } $hta .= GWF_HTAccess::getPostHTAccess(); return file_put_contents(GWF_WWW_PATH . '.htaccess', $hta); }