/** * Smarty resource plug-in for fetching templates from the ATK theme. * * @author Peter C. Verhage <*****@*****.**> */ function smarty_resource_theme_source($tpl_name, &$tpl_source, &$smarty) { $theme =& atkTheme::getInstance(); $path = $theme->tplPath($tpl_name); if (!empty($path)) { $tpl_source = file_get_contents($path); if (atkconfig('debug') >= 3) { $tpl_source = "\n<!-- START [{$path}] -->\n" . $tpl_source . "\n<!-- END [{$path}] -->\n"; } return true; } else { return false; } }
{ var image = new Image(); image.onerror = atkLockUnlock; image.src = '<?php echo session_url('include.php?file=atk/lock/lock.php&type=image&stack=' . $stack); ?> &id=' + atkLock.theIdentifier + '&sequence=' + atkLock.theSequence; } } /** * When the lock lease has expired we notify the user. */ function atkLockUnlock() { atkLock.isLocked = false; if (typeof(document.images['_lock_']) != 'undefined') document.images['_lock_'].src='<?php echo atkconfig("atkroot"); ?> atk/images/lock_expired.gif'; alert('<?php echo addslashes($message); ?> '); } atkLockInit('<?php echo $id; ?> ');
* @access private * * @copyright (c)2000-2004 Ibuildings.nl BV * @license http://www.achievo.org/atk/licensing ATK Open Source License * * @version $Revision: 1684 $ * $Id$ */ /** @internal includes, defines etc. */ global $ATK_VARS; $id = (int) $ATK_VARS["id"]; $type = $ATK_VARS["type"] == "xml" ? "xml" : "image"; $lock =& atkLock::getInstance(); /* extend lock lease */ if ($lock->extend($id)) { // xml if ($type == "xml") { header("Content-type: text/xml"); echo "<response><success/></response>"; } else { header("Content-type: image/gif"); readfile(atkconfig("atkroot") . 'atk/images/dummy.gif'); } } else { // xml if ($type == "xml") { echo "<response><failure/></response>"; } else { header("HTTP/1.0 404 Not Found"); } }
<?php atkPage::getInstance()->register_script(atkconfig('atkroot') . 'atk/javascript/overlibmws/overlibmws.js'); $theme = atkinstance("atk.ui.atktheme"); $image = $theme->imgPath("help"); $tooltip = atk_htmlentities(str_replace(array("\r\n", "\r", "\n"), ' ', $tooltip)); ?> <img align="top" src="<?php echo $image; ?> " border="0" style="margin-left: 3px;" onmouseover="return overlib( & quot;<?php echo $tooltip; ?> & quot; , BGCLASS, 'overlib_bg', FGCLASS, 'overlib_fg', TEXTFONTCLASS, 'overlib_txt', WIDTH, 300);" onmouseout="return nd();"/>
if (isset($ATK_VARS["atknodetype"]) && isset($ATK_VARS["atkaction"])) { $destination = "dispatch.php?atknodetype=" . $ATK_VARS["atknodetype"] . "&atkaction=" . $ATK_VARS["atkaction"]; if (isset($ATK_VARS["atkselector"])) { $destination .= "&atkselector=" . $ATK_VARS["atkselector"]; } } else { $destination = "welcome.php"; } $frame_top_height = $theme->getAttribute('frame_top_height'); $frame_menu_width = $theme->getAttribute('frame_menu_width'); $topframe =& new atkFrame($frame_top_height ? $frame_top_height : "75", "top", "top.php", FRAME_SCROLL_NO, true); $mainframe =& new atkFrame("*", "main", $destination, FRAME_SCROLL_AUTO, true); $menuframe =& new atkFrame($position == MENU_LEFT || $position == MENU_RIGHT ? $frame_menu_width ? $frame_menu_width : 190 : $menu->getHeight(), "menu", "menu.php", $scrolling); $noframes = '<p>Your browser doesnt support frames, but this is required to run ' . atktext('app_title') . "</p>\n"; $root =& new atkRootFrameset(); if (atkconfig("top_frame")) { $outer =& new atkFrameSet("*", FRAMESET_VERTICAL, 0, $noframes); $outer->addChild($topframe); $root->addChild($outer); } else { $outer =& $root; $outer->m_noframes = $noframes; } $orientation = $position == MENU_TOP || $position == MENU_BOTTOM ? FRAMESET_VERTICAL : FRAMESET_HORIZONTAL; $wrapper =& new atkFrameSet("*", $orientation); if ($position == MENU_TOP || $position == MENU_LEFT) { $wrapper->addChild($menuframe); $wrapper->addChild($mainframe); } else { $wrapper->addChild($mainframe); $wrapper->addChild($menuframe);
function time_format($time, $displayzero = false) { useattrib("atkdurationattribute"); if ($time == 0 && !$displayzero) { return " "; } if (atkconfig("durationformat", 0) == DURATIONFORMAT_DECIMAL) { $decimalvalue = floor(abs($time) / 60) + abs($time) % 60 / 60; $result = ($time < 0 ? "-" : "") . sprintf("%02.02f", $decimalvalue); } elseif (atkconfig("durationformat", 0) == DURATIONFORMAT_TIME) { $result = ($time < 0 ? "-" : "") . floor(abs($time) / 60) . ":" . sprintf("%02d", abs($time) % 60); } return $result; }
<?php /** * Captcha wrapper for displaying a captcha image and storing the displayed code * in the user session */ // captcha directory $captchaDir = atkconfig("atkroot") . "atk/ext/captcha/"; // include captcha class require $captchaDir . "php-captcha.inc.php"; //require("php-captcha.inc.php"); // define fonts $aFonts = array($captchaDir . 'captcha_fonts/VeraBd.ttf', $captchaDir . 'captcha_fonts/VeraIt.ttf', $captchaDir . 'captcha_fonts/Vera.ttf'); // create new image $oPhpCaptcha = new PhpCaptcha($aFonts, 200, 50); $oPhpCaptcha->SetBackgroundImage($captchaDir . 'img/captcha.jpg'); $oPhpCaptcha->Create();
$destination = "index.php?atklogout=true"; if (isset($ATK_VARS["atknodetype"]) && isset($ATK_VARS["atkaction"])) { $destination .= "&atknodetype=" . $ATK_VARS["atknodetype"] . "&atkaction=" . $ATK_VARS["atkaction"]; if (isset($ATK_VARS["atkselector"])) { $destination .= "&atkselector=" . $ATK_VARS["atkselector"]; } } $title = atktext("title_session_expired"); $contenttpl = '<br>%s<br><br><input type="button" onclick="top.location=\'%s\';" value="%s"><br><br>'; $content = sprintf($contenttpl, atktext("explain_session_expired"), str_replace("'", "\\'", $destination), atktext("relogin")); $box = $ui->renderBox(array("title" => $title, "content" => $content)); $page->addContent($box); $output->output($page->render(atktext("title_session_expired"), true)); } else { atksecure(); atkimport("atk.ui.atkpage"); $lockType = atkconfig("lock_type"); if (!empty($lockType)) { atklock(); } $flags = array_key_exists("atkpartial", $ATK_VARS) ? HTML_PARTIAL : HTML_STRICT; //Load controller if ($ATK_VARS["atkcontroller"] == "") { $controller =& atkinstance("atk.atkcontroller"); } else { $controller =& atkinstance($ATK_VARS["atkcontroller"]); } //Handle http request $controller->dispatch($ATK_VARS, $flags); } $output->outputFlush();
*/ // read data directly from database because session is cached // secutity class.auth_db.inc->selectUser writes user info to db $usertable = atkconfig("auth_usertable"); $userfield = atkconfig("auth_userfield"); $userid = $user['id']; $query = "SELECT allowed_ip, is_suspended, last_seen_on, tbl_prefix FROM {$usertable} WHERE id ='{$userid}'"; $db =& atkGetDb(atkconfig("auth_database")); $recs = $db->getrows($query); $db_allowed_ip = $recs[0]['allowed_ip']; $db_is_suspended = $recs[0]['is_suspended']; $db_last_seen_on = $recs[0]['last_seen_on']; $db_tbl_prefix = $recs[0]['tbl_prefix']; $exp = explode(';', $db_last_seen_on); $db_last_seen_ip = $exp[0]; $last_seen_on = $_SERVER[REMOTE_ADDR] . '; ' . atkconfig('identifier') . '=' . htmlspecialchars($_COOKIE[atkconfig('identifier')]); // check if IP is allowed if ($db_allowed_ip && $db_allowed_ip != '0' && $db_allowed_ip != ';') { $pass_ip = false; $exp = explode(';', $db_allowed_ip); foreach ($exp as $ip) { if (trim($ip) == $_SERVER[REMOTE_ADDR]) { $pass_ip = true; break; } } if (!$pass_ip) { $content = atktext('ip_not_allowed_ml'); $content .= '<br><br><center>IP: ' . $_SERVER[REMOTE_ADDR] . '</center>'; show_error_window($content, false); die;
* subfolders. In advance to using this file, the config variables * whithin this file must be adjusted. * * @package achievo * * @author guido <*****@*****.**> * * @copyright (c) 2005 Ibuildings.nl BV * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2 * * @version $Revision: 2271 $ * $Id: test.php 2271 2007-06-27 06:17:18Z guido $ */ /** * @internal includes */ $config_atkroot = "./"; include_once "atk.inc"; // Start session atksession(); // Require ATK authentication if not running in text mode if (PHP_SAPI != "cli") { atksecure(); } // Set the maximum execution time of all tests together set_time_limit(atkconfig("test_maxexecutiontime")); // Include the Achievo extended webtestcase (features loginAchievo function) atkimport("test.achievowebtestcase"); // Let the atktestsuite run the requested tests in an appropriate format $suite =& atknew("atk.test.atktestsuite"); $suite->run(PHP_SAPI != "cli" ? "html" : "text", atkArrayNvl($_REQUEST, "atkmodule"));
<?php //@set_time_limit(240); /******************************************************************************* * FPDF MOD 4 ATK * * * * Author: Alcal * *******************************************************************************/ require 'tcpdf/config/lang/eng.php'; if (atkconfig('compress_pdf') == true) { require 'tcpdf/tcpdf_compressed.php'; } else { require 'tcpdf/tcpdf.php'; } //define('FPDF_FONTPATH',$_SERVER['DOCUMENT_ROOT'].'/tokyo/moduli/pdf/fpdf/font/'); // dejavusans = utf8 **very slow!, helvetica = non-utf8 fast! // TCPDF function _putresources() -> _putfonts() @8830 is slow for utf8 define('MAIN_ATK_FONT', 'dejavusans'); class atkpdf extends TCPDF { public function atkpdf() { //call original constructor $this->__construct(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); } function set_doc_properties($report_title, $orientation = 'P', $header = array(), $image = '', $imagewidth = 0) { //define ('DATE_FORMATTING', 'd/M/Y H:i'); define('DATE_FORMATTING', atktext('date_format_pdfreport')); define('ATK_PDF_SETCREATOR', $header['CREATOR']); define('ATK_PDF_SETAUTHOR', $header['AUTHOR']);
<?php include_once atkconfig("atkroot") . "atk/ui/smarty/Smarty.class.php"; /** * Project: Smarty: the PHP compiling template engine * File: Smarty_Compiler.class.php * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * @link http://smarty.php.net/ * @author Monte Ohrt <monte at ohrt dot com> * @author Andrei Zmievski <*****@*****.**> * @version 2.6.11 * @copyright 2001-2005 New Digital Group, Inc. * @package Smarty */ /* $Id: Smarty_Compiler.class.php 6354 2009-04-15 02:41:21Z mvdam $ */ /** * Template compiling class
/** * Function for getting a configuration variable and set this in a variable in smarty. * * @author Lineke Kerckhoffs-Willems <*****@*****.**> */ function smarty_function_atkconfig($params, &$smarty) { $smarty->assign($params["smartyvar"], atkconfig($params["var"])); }
function getFirmData($id) { $sql = "SELECT * FROM ia32_config"; $conn = atkGetUser(atkconfig('auth_dbconfigfield')); $db =& atkGetDb($conn); $user_prefix = atkGetUser(atkconfig('auth_tblprefixfield')); $sql = str_replace('ia32_', $user_prefix, $sql); $ret = $db->getrows($sql); return $ret[0]; }
// restore to the original, // for node installations // may be dependent on // the value of this setting. // for example, employee only // adds a password field if // authentication is 'db'. if ($g_user["name"] != "administrator") { $errors[] = "You can only run the install script using the 'administrator' account."; } // Now that we have included the configfile, we can validate the database setup. // Note: we don't check the existance of the database or its tables yet, since // the installer can install the database if needed. Here, we just check if PHP // was compiled with the correct database support. $dbs = array("mysqli" => "mysqli_connect", "oci8" => "OCILogon", "oci9" => "OCILogin", "pgsql" => "pg_connect"); $dbconfig = atkconfig("db"); if (!function_exists($dbs[$dbconfig["default"]["driver"]])) { $errors[] = "Your PHP installation seems to be compiled without <b>" . $dbconfig["default"]["driver"] . "</b>\n database support.\n <br>Please recompile PHP with support for " . $dbconfig["default"]["driver"] . ", or, if you\n installed from rpm, install the php rpm for this database.\n <br>Alternatively, select a different database in the config.inc.php file (<b>\$config_database</b>)."; } // If there are any errors when we reach this point, it's no use continuing because // we don't have a correct database setup, so we can't continue setup. if (count($errors) > 0) { displayErrors($errors); exit; } // Create node $obj =& atkGetNode("setup.setup"); if ($ATK_VARS["atkaction"] == "") { $ATK_VARS["atkaction"] = "intro"; } if (is_object($obj)) {
* Module Resource planning * Ganttchart resource planning * * This file generates the ganttchart. . * * @author Ludo M. Beumer <*****@*****.**> * @version $Revision$ * * $Id$ */ chdir("../.."); $config_atkroot = "./"; include_once $config_atkroot . "atk.inc"; include_once moduleDir("graph") . "jpgraph/jpgraph.php"; include_once moduleDir("graph") . "jpgraph/jpgraph_gantt.php"; include_once atkconfig("atkroot") . "atk/utils/adodb-time.inc.php"; atkimport("module.utils.dateutil"); include_once "achievotools.inc"; atksession(); atksecure(); global $g_securityManager; if ($g_securityManager->allowed("project.project", "any_project")) { $coordinator = $_REQUEST["coordinator"]; } else { $user = getUser(); $coordinator = $user["id"]; } function dashDate($undasheddate) { return substr($undasheddate, 0, 4) . "-" . substr($undasheddate, 4, 2) . "-" . substr($undasheddate, 6, 2); }
* * This file is the skeleton main include wrapper, which you can copy * to your application dir and modify if necessary. It is used to * include popups in a safe manner. Any popup loaded with this wrapper * has session support and login support. * Only files defined in the $config_allowed_includes array are allowed * to be included. * * @package atk * @subpackage skel * * @author Ivo Jansch <*****@*****.**> * * @copyright (c)2000-2004 Ibuildings.nl BV * @license http://www.achievo.org/atk/licensing ATK Open Source License * * @version $Revision: 1090 $ * $Id: include.php 1090 2005-09-21 15:07:31Z ivo $ */ /** * @internal includes */ $config_atkroot = "./"; include_once "atk.inc"; atksession(); atksecure(); $file = $ATK_VARS["file"]; $allowed = atkconfig("allowed_includes"); if (atk_in_array($file, $allowed)) { include_once atkconfig("atkroot") . $file; }
* Configuration file for the File Manager Connector for PHP. */ $config_atkroot = "../../../../../../../"; include_once $config_atkroot . "atk/include/initial.inc"; global $Config; // SECURITY: You must explicitly enable this "connector". (Set it to "true"). // WARNING: don't just set "$Config['Enabled'] = true ;", you must be sure that only // authenticated users can access this file or use some kind of session checking. $Config['Enabled'] = atkconfig('fck_filemanager_enabled'); // Path to user files relative to the document root. $Config['UserFilesPath'] = atkconfig('fck_upload_path'); // Fill the following value it you prefer to specify the absolute path for the // user files directory. Useful if you are using a virtual directory, symbolic // link or alias. Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'. // Attention: The above 'UserFilesPath' must point to the same directory. $Config['UserFilesAbsolutePath'] = atkconfig('fck_upload_absolute_path', ''); // Due to security issues with Apache modules, it is recommended to leave the // following setting enabled. $Config['ForceSingleExtension'] = true; // Perform additional checks for image files. // If set to true, validate image size (using getimagesize). $Config['SecureImageUploads'] = true; // What the user can do with this connector. $Config['ConfigAllowedCommands'] = array('QuickUpload', 'FileUpload', 'GetFolders', 'GetFoldersAndFiles', 'CreateFolder'); // Allowed Resource Types. $Config['ConfigAllowedTypes'] = array('File', 'Image', 'Flash', 'Media'); // For security, HTML is allowed in the first Kb of data for files having the // following extensions only. $Config['HtmlExtensions'] = array("html", "htm", "xml", "xsd", "txt", "js"); // After file is uploaded, sometimes it is required to change its permissions // so that it was possible to access it at the later time.
// check autorefresh call if (atkConfig::getGlobal('session_autorefresh') && array_key_exists(atkConfig::getGlobal('session_autorefresh_key'), $_GET)) { die(session_id()); } atksecure(); $theme =& atkinstance('atk.ui.atktheme'); if (atkconfig("fullscreen")) { // Fullscreen mode. Use index.php as launcher, and launch app.php fullscreen. atksession(); atksecure(); $page =& atknew("atk.ui.atkpage"); $ui =& atkinstance("atk.ui.atkui"); $theme =& atkTheme::getInstance(); $output =& atkOutput::getInstance(); $page->register_style($theme->stylePath("style.css")); $page->register_script(atkconfig("atkroot") . "atk/javascript/launcher.js"); $content = '<script language="javascript">atkLaunchApp(); </script>'; $content .= '<br><br><a href="#" onClick="atkLaunchApp()">' . atktext('app_reopen') . '</a> ' . '<a href="#" onClick="window.close()">' . atktext('app_close') . '</a><br><br>'; $box = $ui->renderBox(array("title" => atktext("app_launcher"), "content" => $content)); $page->addContent($box); $output->output($page->render(atktext('app_launcher'), true)); $output->outputFlush(); } else { if ($theme->getAttribute('useframes', true)) { // Regular mode. app.php can be included directly. include "app.php"; } else { $indexpage =& atknew('atk.ui.atkindexpage'); $indexpage->generate(); } }
// UNIX: // CACHE_DIR /tmp/jpgraph_cache/ // TTF_DIR /usr/X11R6/lib/X11/fonts/truetype/ // MBTTF_DIR /usr/share/fonts/ja/TrueType/ // // WINDOWS: // CACHE_DIR $SERVER_TEMP/jpgraph_cache/ // TTF_DIR $SERVER_SYSTEMROOT/fonts/ // MBTTF_DIR $SERVER_SYSTEMROOT/fonts/ // //------------------------------------------------------------------------ // DEFINE("CACHE_DIR","/tmp/jpgraph_cache/"); // DEFINE("TTF_DIR","/usr/X11R6/lib/X11/fonts/truetype/"); // DEFINE("MBTTF_DIR","/usr/share/fonts/ja/TrueType/"); DEFINE("TTF_DIR", './modules/graph/fonts/'); DEFINE("CACHE_DIR", atkconfig('atktempdir') . 'graph/'); //------------------------------------------------------------------------- // Cache directory specification for use with CSIM graphs that are // using the cache. // The directory must be the filesysystem name as seen by PHP // and the 'http' version must be the same directory but as // seen by the HTTP server relative to the 'htdocs' ddirectory. // If a relative path is specified it is taken to be relative from where // the image script is executed. // Note: The default setting is to create a subdirectory in the // directory from where the image script is executed and store all files // there. As ususal this directory must be writeable by the PHP process. DEFINE("CSIMCACHE_DIR", "csimcache/"); DEFINE("CSIMCACHE_HTTP_DIR", "csimcache/"); //------------------------------------------------------------------------ // Defines for font setup