Exemple #1
0
 function __construct($to_address = "", $subject = "", $body = "", $message_type = "")
 {
     $this->default_headers = "X-Mailer: " . APPLICATION_NAME . " " . get_alloc_version();
     $to_address and $this->set_to_address($to_address);
     $subject and $this->set_subject($subject);
     $body and $this->set_body($body);
     $message_type and $this->set_message_type($message_type);
 }
Exemple #2
0
require_once "../alloc.php";
singleton("errors_fatal", true);
singleton("errors_format", "text");
singleton("errors_logged", false);
singleton("errors_thrown", false);
singleton("errors_haltdb", true);
function g($var)
{
    $rtn = $_GET[$var] or $rtn = $_POST[$var] or $rtn = $_REQUEST[$var];
    $var == "options" and $rtn = alloc_json_decode($_POST[$var]);
    return $rtn;
}
if (g("get_server_version")) {
    die(alloc_json_encode(array("version" => get_alloc_version())));
}
if (!version_compare(g("client_version"), get_alloc_version(), ">=")) {
    die("Your alloc client needs to be upgraded.");
}
$sessID = g("sessID");
if (g("authenticate") && g("username") && g("password")) {
    $sessID = services::authenticate(g("username"), g("password"));
    die(alloc_json_encode(array("sessID" => $sessID)));
}
$services = new services($sessID);
$current_user =& singleton("current_user");
if (!$current_user || !is_object($current_user) || !$current_user->get_id()) {
    die(alloc_json_encode(array("reauthenticate" => "true")));
}
if ($sessID) {
    if (method_exists($services, g("method"))) {
        $modelReflector = new ReflectionClass('services');
Exemple #3
0
    }
}
$error and alloc_error($error);
$account = $_POST["account"] or $account = $_GET["account"];
$TPL["account"] = $account;
if (isset($_POST["username"])) {
    $TPL["username"] = $_POST["username"];
} else {
    if ($sess->TestCookie() != "alloc_test_cookie") {
        $TPL["username"] = $sess->TestCookie();
    }
}
if (isset($_GET["forward"])) {
    $TPL["forward_url"] = strip_tags($_GET["forward"]);
}
$TPL["status_line"] = APPLICATION_NAME . " " . get_alloc_version() . " &copy; " . date("Y") . " <a href=\"http://www.cyber.com.au\">Cyber IT Solutions</a>";
if (!is_dir(ATTACHMENTS_DIR . "whatsnew" . DIRECTORY_SEPARATOR . "0")) {
    mkdir(ATTACHMENTS_DIR . "whatsnew" . DIRECTORY_SEPARATOR . "0");
}
$files = get_attachments("whatsnew", 0);
if (is_array($files) && count($files)) {
    while ($f = array_pop($files)) {
        // Only show entries that are newer that 4 weeks old
        if (format_date("U", basename($f["path"])) > mktime() - 60 * 60 * 24 * 28) {
            $x++;
            if ($x > 3) {
                break;
            }
            $str .= $br . "<b>" . $f["restore_name"] . "</b>";
            $str .= "<br><ul>" . trim(file_get_contents($f["path"])) . "</ul>";
            $br = "<br><br>";
Exemple #4
0
        $module_class = $module_name . "_module";
        $module = new $module_class();
        $modules[$module_name] = $module;
    }
}
singleton("modules", $modules);
// Get the web base url SCRIPT_PATH for the alloc site
$path = dirname($_SERVER["SCRIPT_NAME"]);
$bits = explode("/", $path);
is_array($m) && in_array(end($bits), $m) && array_pop($bits);
is_array($bits) and $path = implode("/", $bits);
$path[0] != "/" and $path = "/" . $path;
$path[strlen($path) - 1] != "/" and $path .= "/";
define("SCRIPT_PATH", $path);
unset($m);
$TPL = array("url_alloc_index" => SCRIPT_PATH . "index.php", "url_alloc_login" => SCRIPT_PATH . "login/login.php", "url_alloc_installation" => SCRIPT_PATH . "installation/install.php", "url_alloc_styles" => ALLOC_MOD_DIR . "css/src/", "url_alloc_stylesheets" => SCRIPT_PATH . "css/", "url_alloc_javascript" => SCRIPT_PATH . "javascript/", "url_alloc_images" => SCRIPT_PATH . "images/", "url_alloc_cache" => SCRIPT_PATH . "cache_" . get_alloc_version() . "/", "url_alloc_help" => ALLOC_MOD_DIR . "help" . DIRECTORY_SEPARATOR, "alloc_help_link_name" => end(array_slice(explode("/", $_SERVER["PHP_SELF"]), -2, 1)), "script_path" => SCRIPT_PATH, "main_alloc_title" => end(explode("/", $_SERVER["SCRIPT_NAME"])));
if (file_exists(ALLOC_MOD_DIR . "alloc_config.php")) {
    require_once ALLOC_MOD_DIR . "alloc_config.php";
}
$db = new db_alloc();
singleton("db", $db);
// ATTACHMENTS_DIR is defined above in alloc_config.php
define("ALLOC_LOGO", ATTACHMENTS_DIR . "logos/logo.jpg");
define("ALLOC_LOGO_SMALL", ATTACHMENTS_DIR . "logos/logo_small.jpg");
// If we're inside the installation process
if (defined("IN_INSTALL_RIGHT_NOW")) {
    // Re-direct home if an alloc_config.php already exists
    if (!defined("ALLOCPSA_PLATFORM") && file_exists(ALLOC_MOD_DIR . "alloc_config.php") && is_readable(ALLOC_MOD_DIR . "alloc_config.php") && filesize(ALLOC_MOD_DIR . "alloc_config.php") >= 2 && defined("ALLOC_DB_NAME")) {
        alloc_redirect($TPL["url_alloc_login"]);
        exit;
    }
Exemple #5
0
<?php

/*
 * Copyright (C) 2006-2011 Alex Lance, Clancy Malcolm, Cyber IT Solutions
 * Pty. Ltd.
 * 
 * This file is part of the allocPSA application <*****@*****.**>.
 * 
 * allocPSA is free software: you can redistribute it and/or modify it
 * under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or (at
 * your option) any later version.
 * 
 * allocPSA is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
 * License for more details.
 * 
 * You should have received a copy of the GNU Affero General Public License
 * along with allocPSA. If not, see <http://www.gnu.org/licenses/>.
*/
require_once "../alloc.php";
$TPL["alloc_version"] = get_alloc_version();
$TPL["main_alloc_title"] = "Help - " . APPLICATION_NAME;
include_template("templates/helpM.tpl");