yms/admincp.php
author Dan
Mon, 03 Aug 2009 02:52:59 -0400
changeset 4 9fdc988ce46e
parent 3 6edb31919f0e
child 7 3db638306413
permissions -rw-r--r--
Added counter and ANY_CLIENT settings to ShowAESKey; Significant improvements to claim system: Added master switch for the whole system; Added ability for administrators to "su" to client ID 0 to manage pooled keys; Added ability for admins to release key when it is added
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
     1
<?php
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
     2
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
     3
$plugins->attachHook('session_started', "yms_add_admincp();");
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
     4
 
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
     5
function yms_add_admincp()
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
     6
{
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
     7
  global $paths;
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
     8
 
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
     9
  $paths->addAdminNode('adm_cat_appearance', 'yms_acp_title', 'YMS', scriptPath . '/plugins/yms/icons/admincp.png');
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    10
}
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    11
 
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    12
function page_Admin_YMS()
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    13
{
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    14
  // Security check
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    15
  global $session;
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    16
  if ( $session->auth_level < USER_LEVEL_ADMIN )
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    17
    return false;
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    18
  
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    19
  global $lang;
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    20
  
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    21
  if ( isset($_POST['submit']) )
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    22
  {
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    23
    setConfig('yms_require_reauth', isset($_POST['require_reauth']) ? '1' : '0');
4
9fdc988ce46e Added counter and ANY_CLIENT settings to ShowAESKey; Significant improvements to claim system: Added master switch for the whole system; Added ability for administrators to "su" to client ID 0 to manage pooled keys; Added ability for admins to release key when it is added
Dan
parents: 3
diff changeset
    24
    setConfig('yms_claim_enable', isset($_POST['claim_enable']) ? '1' : '0');
3
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    25
    setConfig('yms_claim_auth_enable', isset($_POST['claimauth_enable']) ? '1' : '0');
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    26
    setConfig('yms_claim_auth_field', $_POST['claimauth_field']);
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    27
    setConfig('yms_claim_auth_url', $_POST['claimauth_url']);
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    28
    setConfig('yms_claim_auth_key', $_POST['claimauth_key']);
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    29
    
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    30
    echo '<div class="info-box">' . $lang->get('yms_acp_msg_saved') . '</div>';
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    31
  }
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    32
 
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    33
  acp_start_form();
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    34
  ?>
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    35
  <h3><?php echo $lang->get('yms_acp_heading_main'); ?></h3>
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    36
  
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    37
  <div class="tblholder">
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    38
  <table border="0" cellspacing="1" cellpadding="4">
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    39
  
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    40
    <tr>
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    41
      <th colspan="2"><?php echo $lang->get('yms_acp_th_main'); ?></th>
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    42
    </tr>
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    43
    
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    44
    <tr>
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    45
      <td class="row2" style="width: 50%;">
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    46
        <?php echo $lang->get('yms_acp_field_require_reauth_title'); ?><br />
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    47
        <small><?php echo $lang->get('yms_acp_field_require_reauth_hint'); ?></small>
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    48
      </td>
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    49
      <td class="row1" style="width: 50%;">
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    50
        <label>
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    51
          <input type="checkbox" name="require_reauth" <?php if ( getConfig('yms_require_reauth', 1) == 1 ) echo 'checked="checked" '; ?>/>
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    52
          <?php echo $lang->get('yms_acp_field_require_reauth'); ?>
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    53
        </label>
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    54
      </td>
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    55
    </tr>
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    56
    
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    57
    <tr>
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    58
      <td class="row2" style="width: 50%;">
4
9fdc988ce46e Added counter and ANY_CLIENT settings to ShowAESKey; Significant improvements to claim system: Added master switch for the whole system; Added ability for administrators to "su" to client ID 0 to manage pooled keys; Added ability for admins to release key when it is added
Dan
parents: 3
diff changeset
    59
        <?php echo $lang->get('yms_acp_field_claim_enable_title'); ?><br />
9fdc988ce46e Added counter and ANY_CLIENT settings to ShowAESKey; Significant improvements to claim system: Added master switch for the whole system; Added ability for administrators to "su" to client ID 0 to manage pooled keys; Added ability for admins to release key when it is added
Dan
parents: 3
diff changeset
    60
        <small><?php echo $lang->get('yms_acp_field_claim_enable_hint'); ?></small>
9fdc988ce46e Added counter and ANY_CLIENT settings to ShowAESKey; Significant improvements to claim system: Added master switch for the whole system; Added ability for administrators to "su" to client ID 0 to manage pooled keys; Added ability for admins to release key when it is added
Dan
parents: 3
diff changeset
    61
      </td>
9fdc988ce46e Added counter and ANY_CLIENT settings to ShowAESKey; Significant improvements to claim system: Added master switch for the whole system; Added ability for administrators to "su" to client ID 0 to manage pooled keys; Added ability for admins to release key when it is added
Dan
parents: 3
diff changeset
    62
      <td class="row1" style="width: 50%;">
9fdc988ce46e Added counter and ANY_CLIENT settings to ShowAESKey; Significant improvements to claim system: Added master switch for the whole system; Added ability for administrators to "su" to client ID 0 to manage pooled keys; Added ability for admins to release key when it is added
Dan
parents: 3
diff changeset
    63
        <label>
9fdc988ce46e Added counter and ANY_CLIENT settings to ShowAESKey; Significant improvements to claim system: Added master switch for the whole system; Added ability for administrators to "su" to client ID 0 to manage pooled keys; Added ability for admins to release key when it is added
Dan
parents: 3
diff changeset
    64
          <input type="checkbox" name="claim_enable" <?php if ( getConfig('yms_claim_enable', 0) == 1 ) echo 'checked="checked" '; ?>/>
9fdc988ce46e Added counter and ANY_CLIENT settings to ShowAESKey; Significant improvements to claim system: Added master switch for the whole system; Added ability for administrators to "su" to client ID 0 to manage pooled keys; Added ability for admins to release key when it is added
Dan
parents: 3
diff changeset
    65
          <?php echo $lang->get('yms_acp_field_claim_enable'); ?>
9fdc988ce46e Added counter and ANY_CLIENT settings to ShowAESKey; Significant improvements to claim system: Added master switch for the whole system; Added ability for administrators to "su" to client ID 0 to manage pooled keys; Added ability for admins to release key when it is added
Dan
parents: 3
diff changeset
    66
        </label>
9fdc988ce46e Added counter and ANY_CLIENT settings to ShowAESKey; Significant improvements to claim system: Added master switch for the whole system; Added ability for administrators to "su" to client ID 0 to manage pooled keys; Added ability for admins to release key when it is added
Dan
parents: 3
diff changeset
    67
      </td>
9fdc988ce46e Added counter and ANY_CLIENT settings to ShowAESKey; Significant improvements to claim system: Added master switch for the whole system; Added ability for administrators to "su" to client ID 0 to manage pooled keys; Added ability for admins to release key when it is added
Dan
parents: 3
diff changeset
    68
    </tr>
9fdc988ce46e Added counter and ANY_CLIENT settings to ShowAESKey; Significant improvements to claim system: Added master switch for the whole system; Added ability for administrators to "su" to client ID 0 to manage pooled keys; Added ability for admins to release key when it is added
Dan
parents: 3
diff changeset
    69
    
9fdc988ce46e Added counter and ANY_CLIENT settings to ShowAESKey; Significant improvements to claim system: Added master switch for the whole system; Added ability for administrators to "su" to client ID 0 to manage pooled keys; Added ability for admins to release key when it is added
Dan
parents: 3
diff changeset
    70
    <tr>
9fdc988ce46e Added counter and ANY_CLIENT settings to ShowAESKey; Significant improvements to claim system: Added master switch for the whole system; Added ability for administrators to "su" to client ID 0 to manage pooled keys; Added ability for admins to release key when it is added
Dan
parents: 3
diff changeset
    71
      <td class="row2" style="width: 50%;">
3
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    72
        <?php echo $lang->get('yms_acp_field_claimauth_enable_title'); ?><br />
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    73
        <small><?php echo $lang->get('yms_acp_field_claimauth_enable_hint'); ?></small>
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    74
      </td>
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    75
      <td class="row1" style="width: 50%;">
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    76
        <label>
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    77
          <input type="checkbox" name="claimauth_enable" <?php if ( getConfig('yms_claim_auth_enable', 1) == 1 ) echo 'checked="checked" '; ?>/>
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    78
          <?php echo $lang->get('yms_acp_field_claimauth_enable'); ?>
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    79
        </label>
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    80
      </td>
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    81
    </tr>
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    82
    
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    83
    <tr>
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    84
      <td class="row2" style="width: 50%;">
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    85
        <?php echo $lang->get('yms_acp_field_claimauth_enable_title'); ?><br />
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    86
        <small><?php echo $lang->get('yms_acp_field_claimauth_enable_hint'); ?></small>
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    87
      </td>
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    88
      <td class="row1" style="width: 50%;">
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    89
        <input type="text" name="claimauth_field" value="<?php echo htmlspecialchars(getConfig('yms_claim_auth_field', '')); ?>" size="40" />
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    90
      </td>
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    91
    </tr>
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    92
    
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    93
    <tr>
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    94
      <td class="row2" style="width: 50%;">
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    95
        <?php echo $lang->get('yms_acp_field_claimauth_url_title'); ?><br />
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    96
        <small><?php echo $lang->get('yms_acp_field_claimauth_url_hint'); ?></small>
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    97
      </td>
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    98
      <td class="row1" style="width: 50%;">
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
    99
        <input type="text" name="claimauth_url" value="<?php echo htmlspecialchars(getConfig('yms_claim_auth_url', '')); ?>" size="40" />
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
   100
      </td>
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
   101
    </tr>
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
   102
    
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
   103
    <tr>
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
   104
      <td class="row2" style="width: 50%;">
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
   105
        <?php echo $lang->get('yms_acp_field_claimauth_key_title'); ?><br />
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
   106
        <small><?php echo $lang->get('yms_acp_field_claimauth_key_hint'); ?></small>
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
   107
      </td>
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
   108
      <td class="row1" style="width: 50%;">
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
   109
        <input type="text" name="claimauth_key" value="<?php echo htmlspecialchars(getConfig('yms_claim_auth_key', '')); ?>" size="40" />
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
   110
      </td>
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
   111
    </tr>
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
   112
    
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
   113
    <tr>
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
   114
      <th colspan="2" class="subhead">
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
   115
        <input name="submit" type="submit" value="<?php echo $lang->get('etc_save_changes'); ?>" />
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
   116
      </th>
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
   117
    </tr>
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
   118
  
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
   119
  </table>
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
   120
  </div>
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
   121
  
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
   122
  </form>
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
   123
  <?php
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
   124
}
6edb31919f0e Added admin CP. Basic feature set is finished!
Dan
parents:
diff changeset
   125