Example #1
0
 /**
  * New password form
  * @param string $code Code password recovery
  */
 public function __confirm($code)
 {
     if (dbQuery('user')->confirmed($code)->first()) {
         $result = '';
         $result .= m()->view('www/signin/new_pass_form')->code($code)->output();
         s()->template('www/signin/signin_template.vphp');
         m()->html($result)->title(t('Восстановление пароля', true));
     } else {
         e404();
     }
 }
Example #2
0
<?php

include "_config.php";
$ce = new \App\CertificateHandler();
$certificate = $ce->findByDomain($_GET['domain']);
if (!$certificate) {
    e404();
}
try {
    header("Content-Type: text/plain");
    echo $certificate->showCertificateFile($_GET['file']);
    exit;
} catch (\Exception $e) {
    e500($e);
}
Example #3
0
}
$imgcontent = file_get_contents($imgfile);
if (!$imgcontent) {
    e404("can't read file");
}
// copy image content into temp filename
$tmpfname = tempnam($cachedir, "tmp.");
$tmpfname = str_replace('\\', '/', $tmpfname);
$tmpfname .= '.' . $ext;
$fp = fopen($tmpfname, "w");
fwrite($fp, $imgcontent);
fclose($fp);
@chmod($tmpfname, 0777);
// create file
$thumb = image_resize($tmpfname, $new_size[0], $new_size[1], '', '', dirname($thumbfile), $qty);
unlink($tmpfname);
if (!is_string($thumb) && !empty($thumb->errors)) {
    // print original image
    header('Content-Type: ' . $filetype['type']);
    echo $imgcontent;
    exit;
    e404("error resize");
}
// rename file to correct name
@chmod($thumb, 0777);
rename($thumb, $thumbfile);
// print image
header('Content-Type: ' . $filetype['type']);
$imgcontent = file_get_contents($thumbfile);
echo $imgcontent;
exit;