public function generator()
    {
        if (issetPost("doGenerate") && issetPost("SCHEME") && issetPost("HOSTNAME") && issetPost("URLPATHNAME")) {
            $this->checkExistingDir($this->strProjectFolder);
            $objFilesystem = new class_filesystem();
            $this->checkWriteableDir($objFilesystem, $this->strProjectFolder);
            $this->deleteFolder($objFilesystem, $this->strSeleniumFolder);
            echo "\n\n### Creating testing suite... ###\n";
            echo "\n Creating folder " . $this->strSeleniumFolder;
            $objFilesystem->folderCreate($this->strSeleniumFolder);
            echo "\n Searching for available Selenium tests...\n";
            $arrFiles = class_resourceloader::getInstance()->getFolderContent("/tests", array(".html", ".htm"));
            echo "\n Found " . count($arrFiles) . " Selenium test(s)\n\n";
            if (count($arrFiles) == 0) {
                echo "\n\n :-(   No Files found.";
            } else {
                $this->createEnvFile($_POST["SCHEME"], $_POST["HOSTNAME"], $_POST["URLPATHNAME"], $_POST["ADMINNAME"], $_POST["ADMINPASSWORD"], $_POST["USERNAME"], $_POST["USERPASSWORD"], $_POST["DBHOST"], $_POST["DBNAME"], $_POST["DBUSER"], $_POST["DBPASSWORD"], $_POST["DBPREFIX"]);
                $strContentTestsuiteFile = <<<HTML
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type" />
<title>Test Suite</title>
</head>
<body>
<table id="suiteTable" cellpadding="1" cellspacing="1" border="1" class="selenium"><tbody>
<tr><td><b>Test Suite</b></td></tr>
<tr><td><a href="setEnv.htm">setEnv</a></td></tr>
HTML;
                if ($_POST["databasehelper"] == "mysql") {
                    echo "\n\n  Adding database helper for MYSQL.\n";
                    $strContentTestsuiteFile .= "\n  <tr><td><a href=\"../.." . class_resourceloader::getInstance()->getCorePathForModule("module_installer") . "/module_installer/tests/selhelper_kaj4x_allInOneInstallerMYSQL.html\">selhelper_MySQL-Installer.html</a></td></tr>";
                } elseif ($_POST["databasehelper"] == "sqlite") {
                    echo "\n\n  Adding database helper for SQLITE.\n";
                    $strContentTestsuiteFile .= "\n  <tr><td><a href=\"../.." . class_resourceloader::getInstance()->getCorePathForModule("module_installer") . "/module_installer/tests/selhelper_kaj4x_allInOneInstallerSQLITE.html\">selhelper_SQLITE-Installer.html</a></td></tr>";
                }
                foreach ($arrFiles as $strPathToFile => $strOneFile) {
                    if (substr($strOneFile, 0, 33) == "selhelper_kaj4x_allInOneInstaller") {
                        continue;
                    }
                    echo "\n  Adding test file: " . $strPathToFile;
                    $strContentTestsuiteFile .= "\n  <tr><td><a href=\"../.." . $strPathToFile . "\">" . $strOneFile . "</a></td></tr>";
                }
                $strContentTestsuiteFile .= <<<HTML
</tbody></table>
</body>
</html>
HTML;
                echo "\n\n  Writing master file for testsuite (Testsuite_YOURHOSTNAME.htm: this contains a link to all the tests)";
                file_put_contents(_realpath_ . $this->strSeleniumFolder . "/Testsuite_" . $_POST["HOSTNAME"] . ".htm", $strContentTestsuiteFile);
                echo "\n\n\n<b>You will find your new files in " . _realpath_ . $this->strSeleniumFolder . "</b>\nOpen the file 'Testsuite_" . $_POST["HOSTNAME"] . ".htm' in your Selenium IDE. All available test cases will be included.";
            }
        }
    }
Пример #2
0
/**
 * Returns a value from the Post-array
 *
 * @param string $strKey
 *
 * @return string
 * @deprecated use @link{class_carrier::getInstance()->getParam("")} instead
 */
function getPost($strKey)
{
    if (issetPost($strKey)) {
        return $_POST[$strKey];
    } else {
        return "";
    }
}
Пример #3
0
<?php

/*"******************************************************************************************************
*   (c) 2004-2006 by MulchProductions, www.mulchprod.de                                                 *
*   (c) 2007-2015 by Kajona, www.kajona.de                                                              *
*       Published under the GNU LGPL v2.1, see /system/licence_lgpl.txt                                 *
********************************************************************************************************/
echo "+-------------------------------------------------------------------------------+\n";
echo "| Kajona Debug Subsystem                                                        |\n";
echo "|                                                                               |\n";
echo "| DB Query Panel                                                                |\n";
echo "|                                                                               |\n";
echo "+-------------------------------------------------------------------------------+\n";
if (issetPost("doquery")) {
    $strQuery = getPost("dbquery");
    if (get_magic_quotes_gpc() == 1) {
        $strQuery = stripslashes($strQuery);
    }
    $objDb = class_carrier::getInstance()->getObjDB();
    echo "query to run " . $strQuery . "\n";
    if ($objDb->_query($strQuery)) {
        echo "\n\nquery successfull.\n";
    } else {
        echo "\n\nquery failed.\n";
    }
} else {
    echo "Provide the query to execute.\nPlease be aware of the consequences!\n\n";
    echo "<form method=\"post\">";
    echo "<textarea name=\"dbquery\" cols=\"75\" rows=\"10\">";
    echo "</textarea><br />";
    echo "<input type=\"hidden\" name=\"doquery\" value=\"1\" />";
Пример #4
0
<?php

/*"******************************************************************************************************
*   (c) 2004-2006 by MulchProductions, www.mulchprod.de                                                 *
*   (c) 2007-2015 by Kajona, www.kajona.de                                                              *
*       Published under the GNU LGPL v2.1, see /system/licence_lgpl.txt                                 *
********************************************************************************************************/
echo "+-------------------------------------------------------------------------------+\n";
echo "| Kajona Debug Subsystem                                                        |\n";
echo "|                                                                               |\n";
echo "| Delete all tables                                                             |\n";
echo "|                                                                               |\n";
echo "+-------------------------------------------------------------------------------+\n";
if (issetPost("dodelete")) {
    $strUsername = getPost("username");
    $strPassword = getPost("password");
    $objUsersource = new class_module_user_sourcefactory();
    $objUser = $objUsersource->getUserByUsername($strUsername);
    echo "Authenticating user...\n";
    if ($objUsersource->authenticateUser($strUsername, $strPassword)) {
        echo " ... authenticated.\n";
        $arrGroupIds = $objUser->getArrGroupIds();
        if (in_array(class_module_system_setting::getConfigValue("_admins_group_id_"), $arrGroupIds)) {
            echo "User is member of admin-group.\n";
            $arrTables = class_carrier::getInstance()->getObjDB()->getTables();
            foreach ($arrTables as $strOneTable) {
                $strQuery = "DROP TABLE " . $strOneTable;
                echo " executing " . $strQuery . "\n";
                class_carrier::getInstance()->getObjDB()->_pQuery($strQuery, array());
            }
        } else {
session_start();
include_once $_SERVER['DOCUMENT_ROOT'] . '/Student-Risk-Monitoring-System/res/php/db.inc.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/Student-Risk-Monitoring-System/res/php/magicQuotes.inc.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/Student-Risk-Monitoring-System/res/php/otherHelpers.inc.php';
magicQuotes();
connect('strims', 'root', 'Martinez');
if (!issetSession('account')) {
    include 'index.php';
    exit;
}
if (issetPost('applyFilter')) {
    $checkEmpty = array('id', 'firstname', 'surname', 'mi', 'yrMin', 'yrMax', 'course', 'dateMin', 'dateMax', 'ageMin', 'ageMax', 'loawRecordMin', 'loawRecordMax', 'y1s1Min', 'y1s1Max', 'y1s2Min', 'y1s2Max', 'y2s0Min', 'y2s0Max', 'y2s1Min', 'y2s1Max', 'y2s2Min', 'y2s2Max', 'y3s0Min', 'y3s0Max', 'y3s1Min', 'y3s1Max', 'y3s2Min', 'y3s2Max', 'y4s0Min', 'y4s0Max', 'y4s1Min', 'y4s1Max', 'y4s2Min', 'y4s2Max', 'y5s0Min', 'y5s0Max', 'y5s1Min', 'y5s1Max', 'y5s2Min', 'y5s2Max', 'riskMin', 'riskMax');
    $checkNum = array('gender', 'scholar', 'dormer', 'currentStatus', 'familyLivingSituation', 'atmosphereAtHome', 'parentsMaritalStatus', 'relFather', 'relMother', 'spiritualSubscale', 'godSubscale', 'problemSolving', 'seekingSocialSupport', 'avoidance', 'lvlDepression', 'lvlAnxiety', 'suicideBehavior', 'suicidalThoughts', 'hypochondriasis', 'depression', 'denial', 'interpersonalProblems', 'alienation', 'persecutoryIdeas', 'anxiety', 'thinkingDisorder', 'impulseExpression', 'socialIntroversion', 'selfDepreciation', 'deviation', 'mentalDisorder', 'alcoholUse', 'drugUse', 'hopelessness', 'traumaAbuse', 'physicalIllness', 'pastSuicidalActs', 'familyHistorySuicide', 'familyHistoryMental', 'stressfulLifeEvents', 'relationalSocialLoss', 'accessLethalMeans', 'disciplinaryCases', 'sexualOrientation');
    $checkNums = array(2, 2, 2, 3, 7, 4, 6, 6, 6, 3, 3, 5, 5, 5, 5, 4, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 2, 3, 2, 2, 2, 2, 2, 2, 3, 2, 3);
    $conditions = array();
    for ($i = 0; count($checkEmpty) > $i; $i++) {
        $check = $checkEmpty[$i];
        $post = getPost($check);
        if ($post != '') {
            $conditions[$check] = $post;
        }
    }
    for ($i = 0; count($checkNum) > $i; $i++) {
        $check = $checkNum[$i];
        if (issetPost($check) && count(getPost($check)) < $checkNums[$i]) {
            $conditions[$check] = '(' . structDelim(getPost($check), ' or ', $check) . ')';
        }
    }
    $searchResult = searchProfiles($conditions);
}
include 'search-profiles.html.php';
Пример #6
0
$objFilesystem = new class_filesystem();
$arrFiles = class_resourceloader::getInstance()->getFolderContent("/tests", array(".php"));
asort($arrFiles);
echo "found " . count($arrFiles) . " test(s)\n\n";
echo "<form method=\"post\">";
echo "Test to run:\n";
echo "<select name=\"testname\" type=\"dropdown\">";
foreach ($arrFiles as $strOneFile) {
    echo "<option id=\"" . $strOneFile . "\" " . (getPost("testname") == $strOneFile ? "selected" : "") . " >" . $strOneFile . "</option>";
}
echo "</select>";
echo "<input type=\"hidden\" name=\"debugfile\" value=\"autotest.php\" />";
echo "<input type=\"hidden\" name=\"dotest\" value=\"1\" />";
echo "<input type=\"submit\" value=\"Run test\" />";
echo "</form>";
if (issetPost("dotest")) {
    $intStart = time();
    $strFilename = getPost("testname");
    $arrFiles = class_resourceloader::getInstance()->getFolderContent("/tests", array(".php"));
    $strSearched = array_search($strFilename, $arrFiles);
    if ($strSearched !== false && substr($strFilename, 0, 5) == "test_" && substr($strFilename, -4) == ".php") {
        echo " \n\nfound test-script " . $strFilename . " \n";
        include_once _realpath_ . $strSearched;
        $arrClasses = get_php_classes(file_get_contents(_realpath_ . $strSearched));
        foreach ($arrClasses as $strClassName) {
            if (uniStripos($strClassName, "test") !== false) {
                $objTest = new $strClassName();
                if ($objTest instanceof class_testbase) {
                    echo " invoking kajonaTestTrigger() on instance of " . $strClassName . "\n\n\n\n";
                    $objTest->kajonaTestTrigger();
                }
<?php

//header('P3P: CP="CAO PSA OUR"');		Fixes IE problem. Does not work with Safari.
session_start();
require_once $_SERVER['DOCUMENT_ROOT'] . '/phpexcel/Classes/PHPExcel.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/phpexcel/Classes/PHPExcel/IOFactory.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/Student-Risk-Monitoring-System/res/php/db.inc.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/Student-Risk-Monitoring-System/res/php/magicQuotes.inc.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/Student-Risk-Monitoring-System/res/php/otherHelpers.inc.php';
magicQuotes();
connect('strims', 'root', 'Martinez');
if (!issetSession('account')) {
    include 'index.php';
    exit;
}
if (!empty($_FILES['file']) || issetPost('add')) {
    if (!empty($_FILES['file'])) {
    } else {
        if (issetPost('add')) {
            $reportString = array('studentId', 'dateReported', 'reportedFrom', 'receivingOffice', 'caseHandler', 'summary', 'riskViolence', 'ideation', 'attempts', 'diagnosis', 'psychiatrist', 'medicine', 'action', 'updatesCaseHandler', 'updatesOHS', 'visitsPsychCounselor');
            $report = array();
            for ($i = 0; count($reportString) > $i; $i++) {
                $report[$reportString[$i]] = getPost($reportString[$i]);
            }
            $addedReport = addReport($report);
        }
    }
}
include 'add-reports.html.php';
			</p>

			<div class="inline space-between">
				<form action="add-profiles.php" method="post" enctype="multipart/form-data">
					<div class="inline">
						<input type="file" name="file" class="btn btn-primary" id="choose-file" />
						<button type="submit" name='upload' class="btn btn-primary" id="upload-file" /><span class="glyphicon glyphicon-upload"></span> Upload File</button>
					</div>
				</form>
				<a href="res/others/Add Students Template.xlsx" download><button class="btn btn-primary"><span class="glyphicon glyphicon-download"></span> Download Template</button></a>
			</div>

			<div class="status">

				<?php 
if (issetPost('upload')) {
    ?>
					<?php 
    if (getPost('upload') == 'success') {
        ?>
						<span class="success-msg">Uploaded file successfully. <?php 
        echo $addedProfiles;
        ?>
 profiles has been added to the database.</span>
					<?php 
    } elseif (getPost('upload') == 'type') {
        ?>
						<span class="error-msg">Interpretation Error. Make sure the excel file is following the template properly.</span>
					<?php 
    } else {
        ?>
Пример #9
0
/*"******************************************************************************************************
*   (c) 2004-2006 by MulchProductions, www.mulchprod.de                                                 *
*   (c) 2007-2015 by Kajona, www.kajona.de                                                              *
*       Published under the GNU LGPL v2.1, see /system/licence_lgpl.txt                                 *
*-------------------------------------------------------------------------------------------------------*
*   $Id$                                           *
********************************************************************************************************/
echo "+-------------------------------------------------------------------------------+\n";
echo "| Kajona Debug Subsystem                                                        |\n";
echo "|                                                                               |\n";
echo "| Format Lang Files                                                             |\n";
echo "|                                                                               |\n";
echo "| Use this script to format all language files.                                 |\n";
echo "| The formatter is based on the Kajona language editor, so you need Java >= 1.6.|\n";
echo "+-------------------------------------------------------------------------------+\n";
if (issetPost("format")) {
    foreach (class_classloader::getInstance()->getCoreDirectories() as $strOneCore) {
        $strJavaCommand = "java -jar '" . _realpath_ . "/" . $strOneCore . "/_debugging/debug/KajonaLanguageEditorCore.jar' --formatLangfiles --projectFolder '" . _realpath_ . "' ";
        echo "starting formatting...\n";
        echo "\rcalling " . $strJavaCommand . "\n";
        $intTemp = "";
        $arrOuput = array();
        exec($strJavaCommand, $arrOuput, $intTemp);
        echo "\n\texit code: " . $intTemp . "\n\n";
        foreach ($arrOuput as $strOneLine) {
            echo "\t" . $strOneLine . "\n";
        }
        echo "\n...finished\n";
        echo "\nIf you encounter an exit code of 127, provide the full path to java in the header of the file.\n";
    }
} else {
Пример #10
0
//search for installers available
$arrInstaller = class_resourceloader::getInstance()->getFolderContent("/installer", array(".php"), false, function ($strFile) {
    return strpos($strFile, "installer_sc_") !== false;
});
asort($arrInstaller);
echo "found " . count($arrInstaller) . " installers(s)\n\n";
echo "<form method=\"post\">";
echo "Test to run:\n";
foreach ($arrInstaller as $strOneFile) {
    echo "<input type=\"checkbox\" id=\"installer[" . $strOneFile . "]\" name=\"installer[" . $strOneFile . "]\" " . (getPost("installername") == $strOneFile ? "selected" : "") . " /><label for=\"installer[" . $strOneFile . "]\">" . $strOneFile . "</label><br />";
}
echo "<input type=\"hidden\" name=\"debugfile\" value=\"autotest.php\" />";
echo "<input type=\"hidden\" name=\"doinstall\" value=\"1\" />";
echo "<input type=\"submit\" value=\"Run Installer\" />";
echo "</form>";
if (issetPost("doinstall")) {
    $intStart = time();
    $arrFiles = class_resourceloader::getInstance()->getFolderContent("/installer", array(".php"), false, function ($strFile) {
        return strpos($strFile, "installer_sc_") !== false && substr($strFile, -4) == ".php";
    });
    foreach (getPost("installer") as $strFilename => $strValue) {
        $strSearched = array_search($strFilename, $arrFiles);
        if ($strSearched !== false) {
            echo " \n\nfound installer " . $strFilename . " \n";
            include_once _realpath_ . $strSearched;
            $strName = $strClass = "class_" . str_replace(".php", "", $strFilename);
            $objInstaller = new $strName();
            $objLang = new class_module_languages_language();
            if ($objInstaller instanceof interface_sc_installer) {
                $strModule = $objInstaller->getCorrespondingModule();
                echo "Module " . $strModule . "...\n";
			<div class="panel-heading">
				<h3 class="panel-title">Student Risk Monitoring System</h3>
			</div>
			<div class="panel-body">
				<form action="." method="post">
					<input type="text" name ="username" class="form-control" placeholder="Username" value="<?php 
echo getPost('username');
?>
" />
					<input type="password" name = "password" class="form-control" placeholder="Password" value="<?php 
echo getPost('password');
?>
" />
					<div>
						<input type="submit" name="log-in" class="btn btn-primary login-button" value="Log In"></input>
						<?php 
if (issetPost('invalid')) {
    ?>
								<span class="credential-warning">Invalid credentials.</span>
						<?php 
}
?>
						<?php 
echo getSession('account');
?>
					</div>
				</form>
			</div>
		</div>
	</body>
</html>
Пример #12
0
<?php

/*"******************************************************************************************************
*   (c) 2004-2006 by MulchProductions, www.mulchprod.de                                                 *
*   (c) 2007-2015 by Kajona, www.kajona.de                                                              *
*       Published under the GNU LGPL v2.1, see /system/licence_lgpl.txt                                 *
********************************************************************************************************/
echo "+-------------------------------------------------------------------------------+\n";
echo "| Kajona Debug Subsystem                                                        |\n";
echo "|                                                                               |\n";
echo "| DB Importer                                                                   |\n";
echo "|                                                                               |\n";
echo "+-------------------------------------------------------------------------------+\n";
if (issetPost("doimport")) {
    $strFilename = getPost("dumpname");
    $objDb = class_carrier::getInstance()->getObjDB();
    echo "importing " . $strFilename . "\n";
    if ($objDb->importDb($strFilename)) {
        echo "\n<span style='color: green;font-weight:bold;'>import successfull.</span>\n";
    } else {
        echo "\n<span style='color: red;font-weight:bold;'>import failed!!</span>\n";
    }
} else {
    echo "Searching for dumps in dbdumps under: " . _projectpath_ . "\n";
    $objFilesystem = new class_filesystem();
    if ($objFilesystem->isWritable("/project/dbdumps")) {
        echo "Searching dbdumps available...\n";
        $arrFiles = $objFilesystem->getFilelist(_projectpath_ . "/dbdumps/", array(".zip", ".gz", ".sql"));
        echo "Found " . count($arrFiles) . " dump(s)\n\n";
        echo "<form method='post'>";
        echo "Dump to import:\n";
<?php

session_start();
include_once $_SERVER['DOCUMENT_ROOT'] . '/Student-Risk-Monitoring-System/res/php/db.inc.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/Student-Risk-Monitoring-System/res/php/magicQuotes.inc.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/Student-Risk-Monitoring-System/res/php/otherHelpers.inc.php';
magicQuotes();
if (issetPost('logout')) {
    $_SESSION['account'] = NULL;
    //setSession('account', NULL);
}
connect('strims', 'root', 'Martinez');
if (issetPost('username') || issetPost('password')) {
    $account = login(getPost('username'), getPost('password'));
    if ($account != NULL) {
        setSession('account', $account);
        //$_SESSION['account'] = $account;
        include 'home.html.php';
        exit;
    } else {
        setPost('invalid', true);
    }
}
if (issetSession('account')) {
    include 'home.html.php';
    exit;
}
include 'index.html.php';