Exemple #1
0
 function addItem_postInsertion()
 {
     /* controllare reload */
     $mail = new Template(Settings::getSkin() . "/user.mail");
     $mail->setContent("name", $_REQUEST['name']);
     $mail->setContent("username", $_REQUEST['username']);
     $mail->setContent("password", $_REQUEST['password']);
     $mail->setContent("message", $_REQUEST['message']);
     mail("{$_REQUEST['email']}", "{Config::getInstance()->getConfigurations()['website']['name']} Login data", $mail->get(), "From: {{Config::getInstance()->getConfigurations()['website']['email']}}");
 }
Exemple #2
0
 function resolve()
 {
     if (class_exists("Auth")) {
         if (isset($this->frame)) {
             $this->template_name = Settings::getSkin() . "/{$this->frame}.html";
         } else {
             $this->template_name = Settings::getSkin() . "/frame-private.html";
         }
         $this->private = true;
     } else {
         if (isset($this->frame)) {
             $this->template_name = Settings::getSkin() . "/{$this->frame}.html";
         } else {
             $this->template_name = Settings::getSkin() . "/frame-public.html";
         }
         $this->private = false;
     }
 }
 /**
  * Default building search template
  *
  * @param Entity $entity
  */
 static function createTemplateSearch($entity)
 {
     $searchTemplate = new Skinlet("autotemplate");
     $templateAsString = $searchTemplate->get();
     if (!is_dir(Settings::getSkin() . '/search/')) {
         mkdir(Settings::getSkin() . '/search/', 0777);
     }
     $filename = Settings::getSkin() . "/search/" . $entity->name . "_search.html";
     if (!file_exists($filename)) {
         $templateAsString = preg_replace("~\\[(?!entity_content\\d+_\\d+).+\\]~Us", "\n<!-- MODIFICA QUESTA LINEA-->" . self::searchFieldsEntity($entity) . "\n<!-- MODIFICA QUESTA LINEA-->\n", $templateAsString);
         $handleFile = fopen($filename, "w");
         fwrite($handleFile, $templateAsString);
         fclose($handleFile);
     }
 }
 function mail($to, $subject, $message, $from)
 {
     $signature = new Template(Settings::getSkin() . "/signature.mail");
     $message .= $signature->get();
     $mail = new zMailer();
     $mail->From = $from;
     $mail->FromName = $from;
     $mail->AddAddress($to);
     $mail->Subject = $subject;
     $mail->Body = eregi_replace("[\\]", '', $message);
     $mail->Send();
 }
Exemple #5
0
    case LOGIN_ERROR:
        $body = new Skinlet("error");
        $body->setContent("message", "Username or password unknown.");
        unset($_SESSION['user']);
        $_SESSION['HTTP_LOGIN'] = false;
        break;
    case PRIVILEDGE_ERROR:
        $body = new Skinlet("error");
        $body->setContent("message", "Warning: you are not permitted to use this service!");
        break;
    case DATAFILTERING_ERROR:
        $body = new Skinlet("error");
        $body->setContent("message", "Warning: you are not permitted to modify this item!");
        break;
    case "pageNotFound":
        $body = new Template(Settings::getSkin() . "/error.html");
        $body->setContent("message", "Warning: page not found!");
        break;
    case NOTIFICATION:
        $main = new Skin("orange");
        $body = new Skinlet("password_notification");
        break;
    case NOTIFICATION_ERROR:
        $main = new Skin("handling");
        $body = new Skinlet("password_notification_error");
        $body->setContent("ip", $_SERVER['REMOTE_ADDR']);
        break;
}
session_destroy();
$main->setContent("body", $body->get());
$main->close();
Exemple #6
0
    }
    function displayItem($item)
    {
        if ($item['operation'] == 'DELETE') {
            $item['link'] = "";
        }
        beContentPager::displayItem($item);
    }
}
$pager = new myPager();
$pager->setQuery("\r\n\tSELECT logs.id,\r\n\t\t   logs.operation,\r\n\t\t   logs.entity,\r\n\t\t   logs.itemid,\r\n\t\t   logs.service,\r\n\t\t   logs.username,\r\n\t\t   logs.date,\r\n\t\t   logs.ip,\r\n\t\t   CONCAT(service,'?action=edit&page=1&value=',logs.itemid) as link\r\n      FROM logs");
$pager->setOrder("date DESC");
if ($_SESSION['user']['admin']) {
    $pager->setFilter("(logs.username LIKE '%[search]%' OR logs.operation LIKE '%[search]%' OR logs.entity LIKE '%[search]%')");
} else {
    $pager->setFilter("(logs.username LIKE '%[search]%' OR logs.operation LIKE '%[search]%' OR logs.entity LIKE '%[search]%') AND logs.username = '******'user']['username']}'");
    #$pager->setFilter("logs.username = '******'user']['username']}'");
}
$pager->setOrder("logs.date DESC");
$pager->setTemplate(Settings::getSkin() . "/report-logs.html");
$form->setPager($pager);
$_REQUEST['action'] = "edit";
$_REQUEST['page'] = "0";
switch ($_REQUEST['action']) {
    case "edit":
        $main->setContent("body", $form->editItem());
        break;
}
$main->close();
?>
 
 function livereport($name, $entityName, $pars)
 {
     $item = new Template(Settings::getSkin() . "/liveReport.html");
     $length = $pars['length'];
     $index = false;
     foreach ($_SESSION['user']['services'] as $k => $v) {
         if ($v['script'] == basename($_SERVER['SCRIPT_FILENAME'])) {
             $index = $k;
             break;
         }
     }
     if (!$index) {
         $item->setContent("title", "Report");
     } else {
         $item->setContent("title", $_SESSION['user']['services'][$index]['serviceName']);
     }
     $entity = DB::getInstance()->getEntityByName($entityName);
     /* echo "var dump di COUNT in report.inc <br>";
     		var_dump(COUNT); */
     $count = $entity->getReference(COUNT);
     #$data = Parser::getResult("SELECT COUNT(*) AS count FROM {$entityName}");
     $item->setContent("length", $length);
     #$item->setContent("total", $data[0]['count']);
     $item->setContent("total", $count);
     $item->setContent("entity", $entityName);
     $item->setContent("script", basename($_SERVER['SCRIPT_FILENAME']));
     $item->setContent("query", Parser::encrypt($GLOBALS['currentform']->reportQuery));
     return $item->get();
 }
 function get()
 {
     //$this->smarty->assign("sys",TagLibrariesFactory::getInstance());
     return $this->smarty->fetch(Settings::getSkin() . "/{$this->template_name}");
 }