コード例 #1
0
ファイル: cron.router.php プロジェクト: parkerj/eduTrac-SIS
/**
 * Updates a cronjob handler.
 *
 * @since 6.0.00
 */
function updateCronjobs($id = '')
{
    $app = \Liten\Liten::getInstance();
    $cronDir = cronDir() . 'cron/';
    if (file_put_contents($cronDir . 'cronjobs.dat.php', '<' . '?php /*' . base64_encode(serialize($_SESSION['cronjobs'])) . '*/')) {
        $app->flash('success_message', _t('Database saved.'));
        // create 'backup'
        file_put_contents($cronDir . 'cronjobs.backup-' . date('Y-m-d') . '.php', '<' . '?php /*' . base64_encode(serialize($_SESSION['cronjobs'])) . '*/');
    } else {
        $app->flash('error_message', _t('Database not saved, could not create database file on server, please check write rights of this script.'));
    }
    // remove old cronjob backup files
    $files = glob($cronDir . 'cronjobs.backup*.php');
    if (is_array($files)) {
        foreach ($files as $file) {
            if (is_file($file) && time() - filemtime($file) >= 2 * 24 * 60 * 60) {
                // 2 days
                unlink($file);
            }
        }
    }
    if ($id != '' && is_numeric($id)) {
        redirect(get_base_url() . 'cron/view' . '/' . $id);
    } else {
        redirect($app->req->server['HTTP_REFERER']);
    }
    exit;
}
コード例 #2
0
ファイル: log.php プロジェクト: parkerj/eduTrac-SIS
    exit('No direct script access allowed');
}
/**
 * Cronjob Handler Log View
 *  
 * @license GPLv3
 * 
 * @since       6.0.00
 * @package     eduTrac SIS
 * @author      Joshua Parker <joshmac3@icloud.com>
 */
$app = \Liten\Liten::getInstance();
$app->view->extend('_layouts/dashboard');
$app->view->block('dashboard');
$flash = new \app\src\Core\etsis_Messages();
$cronlog = cronDir() . 'cron/logs/cronjobs.log';
$screen = 'cron';
?>

<script type="text/javascript">
$(".panel").show();
setTimeout(function() { $(".panel").hide(); }, 5000);
</script>

<ul class="breadcrumb">
	<li><?php 
echo _t('You are here');
?>
</li>
	<li><a href="<?php 
echo get_base_url();
コード例 #3
0
ファイル: application.php プロジェクト: parkerj/eduTrac-SIS
/**
 * Creates a cookies directory with proper permissions.
 */
_mkdir($app->config('cookies.savepath'));
/**
 * Creates a node directory with proper permissions.
 */
_mkdir($app->config('cookies.savepath') . 'nodes' . DS . 'etsis' . DS);
/**
 * Creates a file directory with proper permissions.
 */
_mkdir($app->config('file.savepath'));
/**
 * Creates a cron directory with proper permissions.
 */
_mkdir(cronDir());
/**
 * Creates the cron directory with proper permissions to store
 * cronjob information.
 */
_mkdir(cronDir() . 'cron/logs/');
/**
 * Error log setting
 */
etsis_set_environment();
/**
 * Loads the default textdomain.
 * 
 * @since 6.1.09
 */
load_default_textdomain('edutrac-sis', APP_PATH . 'languages' . DS);