Przeglądaj źródła

new data content element for server variables

master
Dom SP 3 lat temu
rodzic
commit
e6ac8ab715
3 zmienionych plików z 45 dodań i 6 usunięć
  1. +4
    -3
      app/controller/email.php
  2. +27
    -3
      app/modules/filesinfolders.php
  3. +14
    -0
      index.php

+ 4
- 3
app/controller/email.php Wyświetl plik

@@ -86,15 +86,16 @@ class Email {
$smtp->set($k,$v);
}
if ($smtp->send(\Template::instance()->render($template,'text/html'))) {
# if(false) {
$email = \Template::instance()->render($template,'text/html');
//echo $email;
if ($smtp->send($email)) {
$success = true;
} else {
$success = false;
}

if ($success) {
$f3->reroute("/email/success");
$f3->reroute("/email/success?email=".urlsafe_b64encode($email));
} else {
#$f3->reroute("/email/error");
echo \Template::instance()->render($template,'text/html');

+ 27
- 3
app/modules/filesinfolders.php Wyświetl plik

@@ -173,7 +173,7 @@ class FilesInFolders {
);
break;
case 2:
$module = new CEimage(['image',$file,'','gallery']);
$module = new CEimage(['image',$file,'auto','gallery']);
$this->content[$domain][$key."10image"] = $module->index();
unset($module);
break;
@@ -693,7 +693,31 @@ class FilesInFolders {
$new = $el;
break;
}

break;
case 'data':
$method = strtoupper($request[1]);
//$keys = [];
if (in_array($method,['POST','GET','SESSION'])) {
foreach ($body as $line) {
$key = explode("=",$line);
$raw = $f3->get($method.'.'.$key[0]);
if (count($key) >= 2) {
$type=$key[1];
} else {
$type = false;
}
switch ($type) {
case 'base64':
$new = urlsafe_b64decode($raw);
break;
default:
$new = $raw;
}
}
//var_dump($new);
}
break;
case 'image':
@@ -850,7 +874,7 @@ class CEimage
if ($image) {

// image positioning
if( in_array($request[2],array('left','right','full'))) {
if( in_array($request[2],array('left','right','full','auto'))) {
$class = $request[2];
} else {
$class = 'full';

+ 14
- 0
index.php Wyświetl plik

@@ -6,6 +6,20 @@ function debug($message) {
printf("<hr>%s:<br>Memory Usage: %s <br>", $message, memory_get_usage());
}
}
function urlsafe_b64encode($string) {
$data = base64_encode($string);
$data = str_replace(array('+','/','='),array('-','_','.'),$data);
return $data;
}

function urlsafe_b64decode($string) {
$data = str_replace(array('-','_','.'),array('+','/','='),$string);
$mod4 = strlen($data) % 4;
if ($mod4) {
$data .= substr('====', $mod4);
}
return base64_decode($data);
}

/////////////////////////////
// configure installation: //

Ładowanie…
Anuluj
Zapisz