/web/sa/admin/list.php
PHP | 252 lines | 162 code | 87 blank | 3 comment | 3 complexity | ebca33e726a0de3e1be8183724c0a64b MD5 | raw file
- <?php
- include 'gloo.inc' ;
- require_once ($_SERVER['GLOO_INC_DIR'].'class_loader.inc' );
- require_once ($_SERVER['GLOO_INC_DIR'].'session.inc' );
- require_once ($_SERVER['GLOO_INC_DIR'].'error.inc' );
-
- //sa/admin/list.php
- $glooWeb = Gloo_Core_Web::getInstance();
- $context = $glooWeb->getContext();
-
- //check context for required role
- $loginPage = '/sa/login.php';
- if(!Gloo_UI_Security::hasSuperAdminLogin($context)) {
- header('Location: '.$loginPage);
- }
-
- $orgId = NULL ;
-
- // org_id should be set in request
- if(empty($_GET['org_id'])) {
- trigger_error('wrong navigation >> org_id is empty ',E_USER_ERROR);
- } else {
- $orgId = $_GET['org_id'];
- }
- $organizationDao = new Gloo_Dao_Organization();
- $organization = $organizationDao->getOnId($orgId);
- $orgName = $organization['name'];
-
-
- $admins= $organizationDao->getOrgAdmins($orgId);
- $glooConfig = Gloo_Config::getInstance();
-
- $glooBackURI = $_GET['g_back_uri'];
- $glooBackURIDecoded = Gloo_Util::base64Decrypt($glooBackURI);
- $glooAdminURI = Gloo_Util::base64Encrypt($_SERVER['REQUEST_URI']);
-
-
- ?>
-
-
-
-
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
- <html><head><title> <?php echo $glooConfig->getFarmName(); ?> </title>
-
-
-
-
- <meta http-equiv="keywords" content="cms,webgloo">
- <meta http-equiv="description" content="webgloo admin application">
- <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
- <link REL=StyleSheet HREF="/art/common/yui/2.9.0/reset-fonts-grids.css" TYPE="text/css" MEDIA=screen>
- <link REL=StyleSheet HREF="/art/minimal/main.css" TYPE="text/css" MEDIA=screen>
- <link REL=StyleSheet HREF="/art/minimal/admin.css" TYPE="text/css" MEDIA=screen>
-
- <script type="text/javascript" src="/js/jquery/1.6.4/jquery-1.6.4.min.js"></script>
- <script type="text/javascript" src="/js/validation/1.9.0/jquery.validate.min.js"></script>
-
- <script type="text/javascript" src="/js/gloo/gloo.js"></script>
-
-
-
- <script type="text/javascript">
-
- function jquery_fns() {
- $("#admin_add_form").validate({
- errorLabelContainer: $("#admin_add_form div.error")
- });
-
- }
- $(document).ready(function(){
- jquery_fns();
- });
-
-
- </script>
-
-
-
-
-
- </head>
- <body>
- <?php include($location->SA_TOP_BAR) ?>
- <div id="custom-doc" class="yui-t1">
-
-
- <div id="hd" role="banner">
- <?php include($location->SA_HEADER) ?>
- <div id="crumbs-container">
- <div class="crumbs_right_bg">
- <ul id="bread-crumbs">
- <li> <a href="<?php echo $glooBackURIDecoded; ?>">Home </a> </li>
- <li class="last"> <a href="<?php echo $_SERVER['REQUEST_URI']; ?>">admins</a> </li>
-
- </ul>
- </div>
-
- </div>
-
- </div>
-
- <div id="bd" role="main">
- <div id="yui-main">
- <div class="yui-b">
- <div class="yui-g">
-
-
- <div id="content">
-
-
- <?php
- $sticky = $glooWeb->getStickyMap('admin_add_form');
- $glooPageSection = 'admin_add_form';
- include ($_SERVER['GLOO_INC_DIR'].'script_message.inc');
- ?>
- <h2> Admins ‐ <?php echo $orgName ;?> </h2>
-
-
- <div class="box_top_bg">
- <div> <div> </div> </div>
- </div>
-
- <div id="form">
- <form class="sform" id="admin_add_form" name="admin_add_form"
- action="<?php echo url::base() ?>/sa/admin/frm/add.php" method="POST">
- <div class="error" > </div>
- <table cellspacing="5" class="formGroup">
- <tr>
- <td class="field">First name<span class="red-label">*</span> </td>
- <td> <input type="text" name="first_name" maxlength="32" class="required" title="First Name is required" value="<?php echo $sticky->get('first_name'); ?>" /></td>
- </tr>
- <tr>
- <td class="field">Last name<span class="red-label">*</span> </td>
- <td> <input type="text" name="last_name" maxlength="32" class="required" title="Last Name is required" value="<?php echo $sticky->get('last_name'); ?>" /></td>
- </tr>
- <tr>
- <td class="field"> Email<span class="red-label">*</span> </td>
- <td> <input type="text" name="email" maxlength="64" class="required validate-email" title="Admin needs a valid email " value="<?php echo $sticky->get('email'); ?>" /></td>
- </tr>
-
- <tr>
- <td class="field">Password<span class="red-label">*</span> </td>
- <td> <input id="password1" type="password" name="password1" maxlength="32" class="required" minlength="6" title="Minimum lenght of password is 6!" value="" /></td>
- </tr>
-
- <tr>
- <td class="field">Password again <span class="red-label">*</span> </td>
- <td> <input id="password2" type="password" name="password2" maxlength="32" class="required" minlength="6" equalTo="#password1" title="Passwords do not match" value="" /></td>
- </tr>
-
- <tr>
- <td> </td>
- <td>
-
- <div>
- <div class="submit">
- <div>
- <button type="submit" name="save" value="Save" onclick="this.setAttribute('value','Save');" ><span>Save</span></button>
- </div>
- </div>
-
- <div class="button">
- <div>
- <button type="button" name="cancel" onClick="javascript:go_back('<?php echo $glooBackURIDecoded ?>');"><span>Cancel</span></button>
-
- </div>
- </div>
- </div>
-
- </td>
-
- </tr>
-
- </table>
- <input type="hidden" name="org_id" value="<?php echo $orgId ?>" />
- <input type="hidden" name="g_page_uri" value="<?php echo $_SERVER['REQUEST_URI']; ?>"/>
-
-
-
- </form>
- </div> <!-- form -->
-
-
- <div class="box_bottom_bg">
- <div> <div> </div> </div>
- </div>
-
-
- <!-- Admins table -->
- <div class="padded-container">
-
- <table class="data">
- <tr>
- <th> <span> Name </span> </th>
- <th> <span> Email </span> </th>
- <th><span> </span> </th>
- <th> <span> </span> </th>
- </tr>
-
- <?php
- foreach ($admins as $admin) {
-
- ?>
-
- <tr>
-
- <td> <?php echo $admin['first_name']; ?> <?php echo $admin['last_name']; ?> </td>
- <td> <a href="mailto:<?php echo $admin['login'];?> "><?php echo $admin['login'];?></a> </td>
- <td>
- <a href="/sa/admin/reset.php?org_id=<?php echo $orgId ?>&admin_id=<?php echo $admin['id'] ?>&g_home_uri=<?php echo $glooBackURI;?>&g_admin_uri=<?php echo $glooAdminURI;?>"> reset password </a>
- </td>
-
- <td>
- <a href="/sa/admin/delete.php?org_id=<?php echo $orgId ?>&admin_id=<?php echo $admin['id'] ?>&g_home_uri=<?php echo $glooBackURI;?>&g_admin_uri=<?php echo $glooAdminURI;?>"> delete </a>
- </td>
- </tr>
-
-
- <?php } ?>
- </table>
- </div>
-
-
- </div> <!-- content -->
-
-
- </div>
- </div> <!-- block1 -->
- </div> <!-- yui-main -->
-
- <div class="yui-b">
-
-
- </div> <!-- block2 -->
-
- </div> <!-- bd -->
-
-
- </div> <!-- custom-doc -->
-
-
- <div id="ft" role="contentinfo"> <?php include($location->GLOO_PAGE_FOOTER); ?> </div>
-
-
-
-
- </body>
- </html>
-
-
-