Overview

Packages

  • Horde
  • None

Classes

  • Horde_Ajax_Application
  • Horde_Api
  • Horde_Block_Account
  • Horde_Block_Account_Base
  • Horde_Block_Account_Finger
  • Horde_Block_Account_Ldap
  • Horde_Block_Account_Localhost
  • Horde_Block_Cloud
  • Horde_Block_FbStream
  • Horde_Block_Feed
  • Horde_Block_Fortune
  • Horde_Block_Google
  • Horde_Block_Iframe
  • Horde_Block_Metar
  • Horde_Block_Moon
  • Horde_Block_Sunrise
  • Horde_Block_Time
  • Horde_Block_TwitterTimeline
  • Horde_Block_Vatid
  • Horde_Block_Weather
  • Horde_LoginTasks_SystemTask_GarbageCollection
  • Horde_LoginTasks_SystemTask_Upgrade
  • Horde_LoginTasks_Task_AdminCheck
  • Horde_LoginTasks_Task_LastLogin
  • Horde_LoginTasks_Task_TosAgreement
  • Horde_Prefs_Ui
  • Overview
  • Package
  • Class
  • Tree
 1: <?php
 2: /**
 3:  * Login task to check various Horde configuration/setup values, and then
 4:  * report failures to an admin via the notification system.
 5:  *
 6:  * Copyright 2011-2012 Horde LLC (http://www.horde.org/)
 7:  *
 8:  * See the enclosed file COPYING for license information (LGPL). If you
 9:  * did not receive this file, see http://www.horde.org/licenses/lgpl21.
10:  *
11:  * @author   Michael Slusarz <slusarz@horde.org>
12:  * @category Horde
13:  * @license  http://www.horde.org/licenses/lgpl21 LGPL 2.1
14:  * @package  Horde
15:  */
16: class Horde_LoginTasks_Task_AdminCheck extends Horde_LoginTasks_Task
17: {
18:     /**
19:      * The interval at which to run the task.
20:      *
21:      * @var integer
22:      */
23:     public $interval = Horde_LoginTasks::EVERY;
24: 
25:     /**
26:      * Display type.
27:      *
28:      * @var integer
29:      */
30:     public $display = Horde_LoginTasks::DISPLAY_NONE;
31: 
32:     /**
33:      * Constructor.
34:      */
35:     public function __construct()
36:     {
37:         $this->active = $GLOBALS['registry']->isAdmin();
38:     }
39: 
40:     /**
41:      * Perform all functions for this task.
42:      */
43:     public function execute()
44:     {
45:         /* Check if test script is active. */
46:         if (empty($GLOBALS['conf']['testdisable'])) {
47:             $GLOBALS['notification']->push(_("The test script is currently enabled. For security reasons, disable test scripts when you are done testing (see horde/docs/INSTALL)."), 'horde.warning');
48:         }
49: 
50:         /* Check that logger configuration is correct. */
51: 
52:         // Ensure Logger object was initialized.
53:         $GLOBALS['injector']->getInstance('Horde_Log_Logger');
54: 
55:         if ($error = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Logger')->error) {
56:             $GLOBALS['notification']->push($error, 'horde.warning');
57:         }
58: 
59:         if (!empty($GLOBALS['conf']['sql']['phptype'])) {
60:             /* Check for outdated DB schemas. */
61:             $migration = new Horde_Core_Db_Migration();
62:             foreach ($migration->apps as $app) {
63:                 $migrator = $migration->getMigrator($app);
64:                 if ($migrator->getTargetVersion() > $migrator->getCurrentVersion()) {
65:                     $GLOBALS['notification']->push(_("At least one database schema is outdated."), 'horde.warning');
66:                     // Redirection is broken, we need to set target of Horde_LoginTasks_Tasklist here, but there is not access to that instance.
67:                     //Horde::url('admin/config', true, array('app' => 'horde'))
68:                     //    ->redirect();
69:                 }
70:             }
71:         }
72:     }
73: }
74: 
API documentation generated by ApiGen