Changeset 94a2d9e in iPeer


Ignore:
Timestamp:
2012-12-11T16:21:57-08:00 (6 years ago)
Author:
John Hsu <john.hsu@…>
Branches:
3.1.x, dev, hotfix, master, pagodabox, ticket463
Children:
464c638
Parents:
d272d23
Message:

Installer: fix debug, move ldap to optional, css.

Debug panel fails in the installer because the User model isn't
initialized during installation (no User table yet). Added checks so
that it only attempts to get user information if the User model is
present.

The PHP LDAP module check should be in the Optional Requirements section
since it's only necessary if they want to use LDAP authentication.

Change the CSS for .help so that it only applies to the installer div
and it's more visible.

Location:
app
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • app/views/elements/global/debug.ctp

    rd272d23 r94a2d9e  
    1313        $commit = "Unknown";
    1414    }
     15    $hasUserModel = class_exists('User');
    1516?>
    1617
     
    2021  <table>
    2122  <tr>
    22     <td><a href="#user-data">User ID: <?php echo User::isLoggedIn() ? User::get('id') : "none" ?></a>
     23    <td>
     24        <a href="#user-data">User ID:
     25        <?php
     26            echo $hasUserModel && User::isLoggedIn() ? User::get('id') : "none";
     27        ?>
     28        </a>
    2329      <input type="button" onclick="jQuery('#user-data').toggle();" value="show/hide" />
    2430    </td>
    25     <td><a href="#role-data">Role: <?php echo count(User::getRoleArray()); ?></a>
    26       <input type="button" onclick="jQuery('#role-data').toggle();" value="show/hide" />
     31    <td><a href="#role-data">
     32        Role: <?php echo $hasUserModel ? count(User::getRoleArray()) : "no user"; ?>
     33        </a>
     34        <input type="button" onclick="jQuery('#role-data').toggle();" value="show/hide" />
    2735    </td>
    28     <td><a href="#permission-data">Permission: <?php echo count(User::getPermissions()); ?></a>
     36    <td><a href="#permission-data">
     37Permission: <?php echo $hasUserModel ? count(User::getPermissions()) : "no user"; ?></a>
    2938      <input type="button" onclick="jQuery('#permission-data').toggle();" value="show/hide" />
    3039    </td>
     
    4958<?php
    5059  // echo prevent the use of the short form conditional operator for some reason
    51   if (User::isLoggedIn())
     60  if ($hasUserModel && User::isLoggedIn())
    5261  { // escape html so they're not interpreted by the browser
    5362    echo htmlspecialchars(print_r(User::getInstance(), true));
     
    6473<?php
    6574  // echo prevent the use of the short form conditional operator for some reason
    66   if (User::isLoggedIn()) {
     75  if ($hasUserModel && User::isLoggedIn()) {
    6776      // escape html so they're not interpreted by the browser
    6877      echo htmlspecialchars(print_r(User::getRoleArray(), true));
     
    7685  <pre style="background-color:#E9FFFF;display: none;" id="permission-data" >
    7786<?php
    78     $perms = User::getPermissions();
     87    $perms = $hasUserModel ? User::getPermissions() : array();
    7988    if (empty($perms)) {
    8089      print_r(__("(Empty)", true));
  • app/views/install/index.ctp

    rd272d23 r94a2d9e  
    33// The detection logic should really be in the controller. But the code is
    44// pretty clean right now, so we'll defer that refactoring until needed.
    5 //
    6 // Need to be restyled so that it looks better. Deferred until default layout
    7 // is refactored.
    85//
    96
     
    1714$yes = '<b class="green">'.__('Yes', true).'</b>';
    1815
    19 // mandatory requirements init
     16// Mandatory requirements init
    2017$phpver = $no;
    2118$REQPHPVER = '5.0';
     
    2623$guard_plugin = $no;
    2724
    28 // optional requirements init
     25// Optional requirements init
    2926$sendmail = $no;
    3027$emailperm = $no;
    3128
    32 // mandatory requirements check
     29// Mandatory requirements check
    3330if (version_compare(phpversion(), $REQPHPVER) >= 0) {
    3431  $phpver = $yes;
     
    5148}
    5249
    53 // optional requirements check
    54 if (ini_get("sendmail_path")) {
     50// Optional requirements check
     51if (ini_get("sendmail_path")) { // send mail
    5552  $sendmail = $yes;
    5653}
     54// email scheduling
    5755$output;
    5856$return_var;
     
    6260  $emailperm = $yes;
    6361}
     62// ldap
     63$ldap = function_exists('ldap_connect') ? $yes : $no;
    6464
    65 // recommended requirements init
     65// Recommended requirements init
    6666$php_recommended_settings = array(
    6767  array (
     
    9595    'recommend' => 'OFF'
    9696  ),
    97   array (
    98     'name' => 'PHP LDAP Extension',
    99     'recommend' => 'Yes',
    100     'actual' => (function_exists('ldap_connect') ? 'Yes' : 'No'),
    101     'description' => 'This has to be enabled if you are planning to use LDAP authenication.'
    102   ),
    10397);
    10498
    105 // recommended requirements check
     99// Recommended requirements check
    106100foreach ($php_recommended_settings as $key => $setting)
    107101{
     
    162156      <td><?php echo $emailperm; ?></td>
    163157  </tr>
     158  <tr>
     159      <td><?php __('PHP LDAP Extension.')?>
     160        <div class="help"><?php __('Required if you are planning to use LDAP authentication.')?></div>
     161      </td>
     162      <td><?php echo $ldap; ?></td>
     163  </tr>
    164164</table>
    165165
  • app/webroot/css/install.css

    rd272d23 r94a2d9e  
    8282}
    8383
    84 .help
     84.install .help
    8585{
    86     font-size: 0.8em;
    87     color: grey;
     86    font-size: 0.9em;
     87    color: chocolate;
    8888    margin: 0.5em 0 0 0;
    8989}
Note: See TracChangeset for help on using the changeset viewer.