Example #1
0
 /**
  * Clear smarty cache.
  */
 public static function wizard_10()
 {
     if (false !== ($error = self::wizard_check_cfg_quick())) {
         return $error;
     }
     $back = self::wizard_h2('10');
     $template_cache = GWF_SMARTY_DIRS . 'tplc';
     if (false === GWF_File::removeDir($template_cache, true, true, false)) {
         $back .= self::wizard_error('err_clear_smarty');
     }
     $back .= sprintf('<p>%s</p>', self::$gwfil->lang('step_10_0'));
     $back .= self::wizard_btn('11');
     return $back;
 }
Example #2
0
 public function on_repo_checkout_Pb()
 {
     GDO::table('Dog_Repo')->createTable(true);
     GDO::table('Dog_RepoSubscribes')->createTable(true);
     GDO::table('Dog_RepoUsers')->createTable(true);
     GWF_File::removeDir(Dog_Repo::baseDir(), false, true, true);
     $argv = $this->argv();
     $argc = count($argv);
     if ($argc !== 3) {
         return $this->showHelp('checkout');
     }
     $type = $argv[1];
     if (!Dog_Repo::isValidType($type)) {
         return $this->rply('err_software');
     }
     $url = @parse_url($argv[2]);
     if (!isset($url['scheme'])) {
         return $this->rply('err_url', $url);
     }
     $url = $argv[2];
     if (!GWF_HTTP::pageExists($url)) {
         return $this->rply('err_connect');
     }
     $name = $argv[0];
     if (!Dog_Repo::isValidName($name)) {
         return $this->rply('err_repo_name');
     }
     if (Dog_Repo::exists($name)) {
         return $this->rply('err_repo_taken');
     }
     if (!GWF_File::createDir(Dog_Repo::repoDir($name))) {
         return $this->rply('err_create_dir');
     }
     if (!($repo = Dog_Repo::create($url, $name, $type))) {
         return Dog::err('ERR_DATABASE', array(__FILE__, __LINE__));
     }
     call_user_func(array($this, 'checkout_' . $type), $repo);
 }
Example #3
0
<?php

$dirname = $home . '/level/4';
if (!Common::isDir($dirname)) {
    GWF_File::removeDir($dirname);
    $dirname2 = "/root/kwd";
    @mkdir($dirname2, 0700, true);
    @chmod($dirname2, 0700);
    @chown($dirname2, $username);
    @chgrp($dirname2, $username);
    @rename($dirname2, $dirname);
}
$filename = $home . '/level/4/README.txt';
if (!Common::isFile($filename)) {
    $filename2 = tempnam("/tmp", "kwf");
    @file_put_contents($filename2, "The solution to level 4 is 'AndIknowchown' without the quotes.\n");
    @chmod($filename2, 00);
    @chown($filename2, $username);
    @chgrp($filename2, $username);
    @rename($filename2, $filename);
}