phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] phpgroupware/login.php admin/inc/hook_deleteacc...


From: Caeies
Subject: [Phpgroupware-cvs] phpgroupware/login.php admin/inc/hook_deleteacc...
Date: Tue, 03 Oct 2006 14:04:58 +0000

CVSROOT:        /cvsroot/phpgroupware
Module name:    setup
Changes by:     Caeies <Caeies> 06/10/03 14:04:58

Modified files:
        phpgroupware   : login.php 
        admin/inc      : hook_deleteaccount.inc.php 
        preferences/inc: hook_preferences.inc.php 
        .              : setup_demo.php 
        templates/base : config.tpl 
Added files:
        preferences/inc: class.uimapping.inc.php 
        preferences/templates/base: mapping.xsl 

Log message:
        SSO login is in ! Still some little thing to adjust, but the big work 
is done, thanks all contributors :)

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/login.php?cvsroot=phpgroupware&r1=1.110&r2=1.111
http://cvs.savannah.gnu.org/viewcvs/admin/inc/hook_deleteaccount.inc.php?cvsroot=phpgroupware&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/preferences/inc/hook_preferences.inc.php?cvsroot=phpgroupware&r1=1.17&r2=1.18
http://cvs.savannah.gnu.org/viewcvs/preferences/inc/class.uimapping.inc.php?cvsroot=phpgroupware&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/preferences/templates/base/mapping.xsl?cvsroot=phpgroupware&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/setup/setup_demo.php?cvsroot=phpgroupware&r1=1.39&r2=1.40
http://cvs.savannah.gnu.org/viewcvs/setup/templates/base/config.tpl?cvsroot=phpgroupware&r1=1.3&r2=1.4

Patches:

Index: admin/inc/hook_deleteaccount.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/admin/inc/hook_deleteaccount.inc.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- admin/inc/hook_deleteaccount.inc.php        26 Sep 2006 07:26:18 -0000      
1.8
+++ admin/inc/hook_deleteaccount.inc.php        3 Oct 2006 14:04:58 -0000       
1.9
@@ -10,10 +10,26 @@
   *  option) any later version.                                              *
   \**************************************************************************/
 
-       /* $Id: hook_deleteaccount.inc.php,v 1.8 2006/09/26 07:26:18 skwashd 
Exp $ */
+       /* $Id: hook_deleteaccount.inc.php,v 1.9 2006/10/03 14:04:58 Caeies Exp 
$ */
 
        if ( isset($_POST['account_id']) && (int) $_POST['account_id'] )
        {
+               // delete all mapping to account
+               // Using Single Sign-On
+               if(isset($GLOBALS['phpgw_info']['server']['mapping']) && 
($GLOBALS['phpgw_info']['server']['mapping'] == 'all' || 
$GLOBALS['phpgw_info']['server']['mapping'] == 'table'))
+               {
+                       $phpgw_map_location = 
isset($_SERVER['HTTP_SHIB_ORIGIN_SITE']) ? $_SERVER['HTTP_SHIB_ORIGIN_SITE'] : 
'local';
+                       $phpgw_map_authtype = 
isset($_SERVER['HTTP_SHIB_ORIGIN_SITE']) ? 'shibboleth':'remoteuser';
+                       if(!is_object($GLOBALS['phpgw']->mapping))
+                       {
+                               $GLOBALS['phpgw']->mapping = 
CreateObject('phpgwapi.mapping', array('auth_type'=> $phpgw_map_authtype, 
'location' => $phpgw_map_location));
+                       }
+                       $account = 
CreateObject('phpgwapi.accounts',$_POST['account_id'],'u');
+                       $data = $account->read();
+                       $account_lid = $data['account_lid'];
+                       
$GLOBALS['phpgw']->mapping->delete_mapping(array('account_lid' => 
$account_lid));
+               }                                                               
                        
+               
                $GLOBALS['phpgw']->accounts->delete($_POST['account_id']);
                $GLOBALS['phpgw']->db->lock(Array('phpgw_acl'));
                $GLOBALS['phpgw']->db->query("DELETE FROM phpgw_acl WHERE 
acl_location='" . (int) $_POST['account_id'] . "'"

Index: preferences/inc/hook_preferences.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/preferences/inc/hook_preferences.inc.php,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -b -r1.17 -r1.18
--- preferences/inc/hook_preferences.inc.php    14 Sep 2006 17:50:00 -0000      
1.17
+++ preferences/inc/hook_preferences.inc.php    3 Oct 2006 14:04:58 -0000       
1.18
@@ -6,13 +6,21 @@
        * @copyright Copyright (C) 2000-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
        * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
        * @package preferences
-       * @version $Id: hook_preferences.inc.php,v 1.17 2006/09/14 17:50:00 
sigurdne Exp $
+       * @version $Id: hook_preferences.inc.php,v 1.18 2006/10/03 14:04:58 
Caeies Exp $
        */
 
        if ($GLOBALS['phpgw']->acl->check('changepassword',1))
        {
                $file['Change your Password'] = 
$GLOBALS['phpgw']->link('/preferences/changepassword.php');
        }
+       if($GLOBALS['phpgw_info']['server']['auth_type'] == 'remoteuser' || 
$GLOBALS['phpgw_info']['server']['half_remote_user'] == 'remoteuser')
+       {
+               if($GLOBALS['phpgw_info']['server']['mapping'] == 'table' || 
$GLOBALS['phpgw_info']['server']['mapping'] == 'all')
+               {
+                       $file['mapping'] = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>'preferences.uimapping.index','appname'=>'preferences'));
+               }
+       }
+                                                                               
                
        $file['change your settings'] = 
$GLOBALS['phpgw']->link('/preferences/preferences.php',array('appname'=> 
'preferences'));
 
        display_section('preferences',$file);

Index: setup/setup_demo.php
===================================================================
RCS file: /cvsroot/phpgroupware/setup/setup_demo.php,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -b -r1.39 -r1.40
--- setup/setup_demo.php        3 Oct 2006 08:27:42 -0000       1.39
+++ setup/setup_demo.php        3 Oct 2006 14:04:58 -0000       1.40
@@ -5,7 +5,7 @@
        * @copyright Copyright (C) 2000-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
        * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
        * @package setup
-       * @version $Id: setup_demo.php,v 1.39 2006/10/03 08:27:42 skwashd Exp $
+       * @version $Id: setup_demo.php,v 1.40 2006/10/03 14:04:58 Caeies Exp $
        */
 
        // Little file to setup a demo install
@@ -219,6 +219,7 @@
                $GLOBALS['phpgw_setup']->db->query('DELETE FROM 
phpgw_accounts');
                $GLOBALS['phpgw_setup']->db->query('DELETE FROM 
phpgw_preferences');
                $GLOBALS['phpgw_setup']->db->query('DELETE FROM phpgw_acl');
+               $GLOBALS['phpgw_setup']->db->query('DELETE FROM phpgw_mapping');
                $contacts = CreateObject('phpgwapi.contacts');
                if(is_array($contacts_to_delete))
                {

Index: setup/templates/base/config.tpl
===================================================================
RCS file: /cvsroot/phpgroupware/setup/templates/base/config.tpl,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- setup/templates/base/config.tpl     6 Aug 2006 10:03:24 -0000       1.3
+++ setup/templates/base/config.tpl     3 Oct 2006 14:04:58 -0000       1.4
@@ -1,4 +1,4 @@
-<!-- $Id: config.tpl,v 1.3 2006/08/06 10:03:24 skwashd Exp $ -->
+<!-- $Id: config.tpl,v 1.4 2006/10/03 14:04:58 Caeies Exp $ -->
 
 <!-- BEGIN header -->
  
@@ -135,6 +135,7 @@
       <option value="ntlm"{selected_auth_type_ntlm}>ntlm</option>
       <option value="exchange"{selected_auth_type_exchange}>exchange</option>
       <option value="ads"{selected_auth_type_ads}>ads</option>
+      <option value="remoteuser"{selected_auth_type_remoteuser}>Remote 
User</option>
       <!-- <option value="http"{selected_auth_type_http}>HTTP</option> -->
       <!-- <option value="nis"{selected_auth_type_nis}>NIS</option> -->
       <!-- <option value="pam"{selected_auth_type_pam}>PAM (Not 
Ready)</option> -->
@@ -143,6 +144,15 @@
    </tr>
 
    <tr class="row_on">
+       <td>{lang_Select_if_you_want_a_fallback}</td>
+       <td>
+        <select name="newsettings[half_remote_user]">
+         <option 
value=""{selected_half_remote_user_}>{lang_Only_the_selected_Auth_Type}</option>
+         <option 
value="remoteuser"{selected_half_remote_user_remoteuser}>{lang_Allow_Remote_User_As_FallBack}</option>
+        </select>
+   </tr>
+
+   <tr class="row_off">
     <td>{lang_Select_where_you_want_to_store/retrieve_user_accounts}:</td>
     <td>
      <select name="newsettings[account_repository]">
@@ -153,25 +163,25 @@
     </td>
    </tr>
 
-   <tr class="row_off">
+   <tr class="row_on">
     <td>{lang_Minimum_account_id_(e.g._500_or_1000,_etc.)}:</td>
     <td><input name="newsettings[account_min_id]" 
value="{value_account_min_id}"></td>
    </tr>
-   <tr class="row_on">
+   <tr class="row_off">
     <td>{lang_Maximum_account_id_(e.g._65535_or_1000000)}:</td>
     <td><input name="newsettings[account_max_id]" 
value="{value_account_max_id}"></td>
    </tr>
 
-   <tr class="row_off">
+   <tr class="row_on">
     
<td>{lang_Minimum_group_id_(e.g._100_or_500,_etc.)_-_should_not_overlap_with_account_ids}}:</td>
     <td><input name="newsettings[group_min_id]" 
value="{value_group_min_id}"></td>
    </tr>
-   <tr class="row_on">
+   <tr class="row_off">
     
<td>{lang_Maximum_group_id_(e.g._499_or_999)_-_should_not_overlap_with_account_ids}:</td>
     <td><input name="newsettings[group_max_id]" 
value="{value_group_max_id}"></td>
    </tr>
 
-   <tr class="row_off">
+   <tr class="row_on">
     <td>{lang_Auto_create_account_records_for_authenticated_users}:</td>
     <td>
       <select name="newsettings[auto_create_acct]">
@@ -181,7 +191,7 @@
     </td>
    </tr>
 
-   <tr class="row_on">
+   <tr class="row_off">
     <td>{lang_Auto-created_user_accounts_expire}:</td>
     <td>
      <select name="newsettings[auto_create_expire]">
@@ -193,12 +203,12 @@
     </td>
    </tr>
 
-   <tr class="row_off">
+   <tr class="row_on">
     
<td>{lang_Add_auto-created_users_to_this_group_('Default'_will_be_attempted_if_this_is_empty.)}:</td>
     <td><input name="newsettings[default_group_lid]" 
value="{value_default_group_lid}"></td>
    </tr>
 
-   <tr class="row_on">
+   <tr class="row_off">
     
<td>{lang_If_no_ACL_records_for_user_or_any_group_the_user_is_a_member_of}:</td>
     <td>
      <select name="newsettings[acl_default]">
@@ -208,15 +218,15 @@
     </td>
    </tr>
 
-   <tr class="row_off">
+   <tr class="row_on">
     <td colspan="2">&nbsp;</td>
    </tr>
 
-       <tr class="row_on">
+       <tr class="row_off">
                <td colspan="2"><b>{lang_If_using_LDAP}:</b></td>
        <tr>
 
-   <tr class="row_off">
+   <tr class="row_on">
      
<td>{lang_Do_you_want_to_manage_homedirectory_and_loginshell_attributes?}:</td>
      <td>
       <select name="newsettings[ldap_extra_attributes]">
@@ -226,42 +236,42 @@
      </td>
     </tr>
 
-   <tr class="row_on">
+   <tr class="row_off">
     
<td>{lang_LDAP_Default_homedirectory_prefix_(e.g._/home_for_/home/username)}:</td>
     <td><input name="newsettings[ldap_account_home]" 
value="{value_ldap_account_home}"></td>
    </tr>
 
-   <tr class="row_off">
+   <tr class="row_on">
     <td>{lang_LDAP_Default_shell_(e.g._/bin/bash)}:</td>
     <td><input name="newsettings[ldap_account_shell]" 
value="{value_ldap_account_shell}"></td>
    </tr>
 
-   <tr class="row_on">
+   <tr class="row_off">
     <td>{lang_LDAP_host}:</td>
     <td><input name="newsettings[ldap_host]" value="{value_ldap_host}"></td>
    </tr>
 
-   <tr class="row_off">
+   <tr class="row_on">
     <td>{lang_LDAP_accounts_context}:</td>
     <td><input name="newsettings[ldap_context]" value="{value_ldap_context}" 
size="40"></td>
    </tr>
 
-   <tr class="row_on">
+   <tr class="row_off">
     <td>{lang_LDAP_groups_context}:</td>
     <td><input name="newsettings[ldap_group_context]" 
value="{value_ldap_group_context}" size="40"></td>
    </tr>
 
-   <tr class="row_off">
+   <tr class="row_on">
     <td>{lang_LDAP_rootdn}:</td>
     <td><input name="newsettings[ldap_root_dn]" value="{value_ldap_root_dn}" 
size="40"></td>
    </tr>
 
-   <tr class="row_on">
+   <tr class="row_off">
     <td>{lang_LDAP_root_password}:</td>
     <td><input name="newsettings[ldap_root_pw]" type="password" 
value="{value_ldap_root_pw}"></td>
    </tr>
 
-   <tr class="row_off">
+   <tr class="row_on">
     <td>{lang_LDAP_encryption_type}:</td>
     <td>
      <select name="newsettings[ldap_encryption_type]">
@@ -270,10 +280,33 @@
     </td>
    </tr>
 
-   <tr class="row_on">
+   <tr class="row_off">
     <td colspan="2">&nbsp;</td>
    </tr>
 
+   <tr class="row_on">
+    <td colspan="2"><b>{lang_If_using_Remote_User}:</b></td>
+   </tr>
+
+   <tr class="row_off">
+    <td>{lang_mapping_kind}:</td>
+       <td>
+        <select name="newsettings[mapping]">
+         <option value="id"{selected_mapping_id}>{lang_Unique_ID}</option>
+         <option 
value="table"{selected_mapping_table}>{lang_Table_mapping}</option>
+         <option value="all"{selected_mapping_all}>{lang_All}</option>
+        </select>
+    </td>
+   </tr>
+
+   <tr class="row_on">
+    <td>{lang_mapping_field}:</td>
+    <td><input name="newsettings[mapping_field]" value="{value_mapping_field}" 
size="40"></td>
+   </tr>
+
+   <tr class="row_off">
+    <td colspan="2">&nbsp;</td>
+   </tr>
 
    <tr class="th">
     <td 
colspan="2"><b>{lang_Mcrypt_settings_(requires_mcrypt_PHP_extension)}</b></td>

Index: preferences/inc/class.uimapping.inc.php
===================================================================
RCS file: preferences/inc/class.uimapping.inc.php
diff -N preferences/inc/class.uimapping.inc.php
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ preferences/inc/class.uimapping.inc.php     3 Oct 2006 14:04:58 -0000       
1.1
@@ -0,0 +1,193 @@
+<?php
+/**
+* phpGroupWare
+*
+* phpgroupware base
+* @author Quang Vu DANG <address@hidden>
+* @copyright Copyright (C) 2000-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
+* @license http://www.gnu.org/licenses/gpl.html GNU General Public License
+* @package phpgroupware
+* @subpackage preferences
+* @version $Id: class.uimapping.inc.php,v 1.1 2006/10/03 14:04:58 Caeies Exp $
+*/
+
+/**
+* this class provide an user interface for manage mapping of current account 
+* if phpGroupware is configured to supports the mapping by table
+* View, Delete, Allow, Deny  mapping
+* Using with Single Sign-On(Shibboleth, CAS...)
+*/
+
+
+       class uimapping
+       {
+               var $public_functions = array('index' => True);
+
+               /**
+               * constructor, sets up variables
+               *
+               */                                                
+               function uimapping()
+               {
+               }
+
+               /**
+               * index
+               * Show mapping list of current account
+               * Delete, Allow, Deny a mapping to current account
+               **/
+               function index()
+               {
+
+                       $GLOBALS['phpgw']->xslttpl->add_file('mapping');
+                       $table_head = array('lang_ext_user' => 
lang('ext_user'), 
+                                               'lang_location' => 
lang('location'),
+                                               'lang_auth_type' => lang('auth 
type'),
+                                               'lang_allow_deny'=>lang('allow 
deny'),
+                                               'lang_delete'=>lang('delete'),
+                                               );
+
+                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
+                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('Mapping preferences');
+                       $title = lang('account') . ': ' .  
$GLOBALS['phpgw_info']['user']['account_lid'];
+                       $app_data = array('title' => $title,'table_head' => 
$table_head);
+                       
+                       $phpgw_map_location = 
isset($_SERVER['HTTP_SHIB_ORIGIN_SITE']) ? $_SERVER['HTTP_SHIB_ORIGIN_SITE'] : 
'local';
+                       $phpgw_map_authtype = 
isset($_SERVER['HTTP_SHIB_ORIGIN_SITE']) ? 'shibboleth':'remoteuser';
+       
+       
+                       //Create the mapping if necessary :
+                       if(isset($GLOBALS['phpgw_info']['server']['mapping']) 
&& !empty($GLOBALS['phpgw_info']['server']['mapping']))
+                       {
+                               if(!is_object($GLOBALS['phpgw']->mapping))
+                               {
+                                       $GLOBALS['phpgw']->mapping = 
CreateObject('phpgwapi.mapping', array('auth_type'=> $phpgw_map_authtype, 
'location' => $phpgw_map_location));
+                               }
+                       }
+
+                       $account_lid =  
$GLOBALS['phpgw_info']['user']['account_lid'];
+                       $data =  
$GLOBALS['phpgw']->mapping->get_list($account_lid);
+                       while(is_array($data) && (list(,$item) = each($data)))
+                       {
+                               $ext_user = $item['ext_user'];
+                               $location = $item['location'];
+                               $auth_type = $item['auth_type'];
+                               if($item['status'] == 'A')
+                               {
+                                       $item['allow_deny_url'] = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>'preferences.uimapping.index',
+                                                                               
                        'appname'=>'preferences',
+                                                                               
                        'action'=>'deny',
+                                                                               
                        'ext_user'=>$ext_user,
+                                                                               
                        'location'=>$location,
+                                                                               
                        'auth_type'=>$auth_type));
+                                       $item['lang_action'] = lang('deny');
+                               }
+                               else
+                               {
+                                       $item['allow_deny_url'] = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>'preferences.uimapping.index',
+                                                                               
                        'appname'=>'preferences',
+                                                                               
                        'action'=>'allow',
+                                                                               
                        'ext_user'=>$ext_user,
+                                                                               
                        'location'=>$location,
+                                                                               
                        'auth_type'=>$auth_type));
+                                       $item['lang_action'] = lang('allow');
+                               }
+                               $item['lang_del'] = lang('delete');
+                               $item['delete_url'] = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>'preferences.uimapping.index',
+                                                                               
                'appname'=>'preferences',
+                                                                               
                'action'=>'delete',
+                                                                               
                'ext_user'=>$ext_user,
+                                                                               
                'location'=>$location,
+                                                                               
                'auth_type'=>$auth_type));
+
+                               if(isset($_SERVER['REMOTE_USER']) && ($ext_user 
== $_SERVER['REMOTE_USER']) &&  ($phpgw_map_location == $location) && 
($phpgw_map_authtype == $auth_type))
+                               {
+                                       $item['lang_action'] = '';
+                                       $item['lang_del'] = '';
+                               }
+               
+                               $app_data['table_row'][] = $item;
+                       }
+                       
+                       $app_data['msg'] = get_var('msg', 'GET', '');
+
+                       $action = get_var('action', 'GET', '');
+                       if ($action)
+                       {
+                               $ext_user = get_var('ext_user', 'GET', '');
+                               $location = get_var('location', 'GET', '');
+                               $auth_type = get_var('auth_type', 'GET', '');
+                               
+                               if(isset($_SERVER['REMOTE_USER']) && ($ext_user 
== $_SERVER['REMOTE_USER']) &&  ($phpgw_map_location == $location) && 
($phpgw_map_authtype == $auth_type))
+                               {
+                                       $msg = lang('Action denied');
+                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction' => 
'preferences.uimapping.index',
+                                                                               
                'appname'=>'preferences',
+                                                                               
                'msg' => $msg));
+                               }
+                               
+                               if ($action == 'allow')
+                               {
+                                       $status = 'A';
+                                       
if($GLOBALS['phpgw']->mapping->update_status(array('account_lid' => 
$account_lid,
+                                                                               
        'ext_user' => $ext_user,
+                                                                               
        'location' => $location,
+                                                                               
        'auth_type' => $auth_type,
+                                                                               
        'status' => $status)))
+                                       {
+                                               $msg = lang('Allow mapping 
success');
+                                       }
+                                       else
+                                       {
+                                               $msg = lang('mapping is not 
exist');
+                                       }
+                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction' => 
'preferences.uimapping.index',
+                                                                               
        'appname'=>'preferences',
+                                                                               
        'msg' => $msg));
+                               }
+                               else if ($action == 'deny')
+                               {
+                       
+                                       $status = 'D';
+                                       
if($GLOBALS['phpgw']->mapping->update_status(array('account_lid' => 
$account_lid,
+                                                                               
        'ext_user' => $ext_user,
+                                                                               
        'location' => $location,
+                                                                               
        'auth_type' => $auth_type,
+                                                                               
        'status' => $status)))
+                                       {
+                                               $msg = lang('Deny mapping 
success');
+                                       }
+                                       else
+                                       {
+                                               $msg = lang('mapping is not 
exist');
+                                       }
+                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=>'preferences.uimapping.index',
+                                                                               
        'appname'=>'preferences',
+                                                                               
        'msg' => $msg));
+                                                                        
+                               }
+                               else if ($action == 'delete')
+                               {
+                                       
if($GLOBALS['phpgw']->mapping->delete_mapping(array('account_lid'=>$account_lid,
+                                                                               
        'ext_user' => $ext_user,
+                                                                               
        'location' => $location,
+                                                                               
        'auth_type' => $auth_type)))    
+                                       {
+                                               $msg = lang('Delete mapping 
success');
+                                       }
+                                       else
+                                       {
+                                               $msg = lang('mapping is not 
exist');
+                                       }
+                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=>'preferences.uimapping.index',
+                                                                               
        'appname'=>'preferences',
+                                                                               
        'msg' => $msg));
+                               }
+                       }
+                       else
+                       {
+                               
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('app_data' => $app_data));
+                       }
+               }
+       }
+?>

Index: preferences/templates/base/mapping.xsl
===================================================================
RCS file: preferences/templates/base/mapping.xsl
diff -N preferences/templates/base/mapping.xsl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ preferences/templates/base/mapping.xsl      3 Oct 2006 14:04:58 -0000       
1.1
@@ -0,0 +1,57 @@
+       <xsl:template match="app_data">
+               <center>
+                <b><xsl:value-of select="title"/></b><br/>
+               <table>
+                    <thead>
+                       <xsl:apply-templates select="table_head" />
+                    </thead>
+                    <tbody>
+                       <xsl:for-each select="table_row">
+                               <xsl:call-template name="table_row">
+                               </xsl:call-template>
+                       </xsl:for-each>
+                    </tbody>
+               </table>
+               <b><xsl:value-of select="msg"/></b><br/>
+               </center>
+       </xsl:template>
+       
+       <xsl:template match="table_head">
+               <tr class="th">
+                       <th><xsl:value-of select="lang_ext_user"/> </th>
+                       <th><xsl:value-of select="lang_location"/> </th>
+                       <th><xsl:value-of select="lang_auth_type"/> </th>
+                       <th><xsl:value-of select="lang_allow_deny"/> </th>
+                       <th><xsl:value-of select="lang_delete"/> </th>
+               </tr>
+       </xsl:template>
+
+       <xsl:template name="table_row">
+               <tr>
+                               <xsl:attribute name="class">
+                                       <xsl:choose>
+                                               <xsl:when test="@class">
+                                                       <xsl:value-of 
select="@class"/>
+                                               </xsl:when>
+                                               <xsl:when test="position() mod 
2 = 0">
+                                                       
<xsl:text>row_off</xsl:text>
+                                               </xsl:when>
+                                               <xsl:otherwise>
+                                                       
<xsl:text>row_on</xsl:text>
+                                               </xsl:otherwise>
+                                       </xsl:choose>
+                               </xsl:attribute>
+                               
+                       <td><xsl:value-of select="ext_user"/> </td>
+                       <td><xsl:value-of select="location"/> </td>
+                       <td><xsl:value-of select="auth_type"/> </td>
+                       <td><a>
+                               <xsl:attribute name="href"><xsl:value-of 
select="allow_deny_url"/></xsl:attribute>
+                               <xsl:value-of select="lang_action"/>
+                       </a></td> 
+                       <td><a> 
+                               <xsl:attribute name="href"><xsl:value-of 
select="delete_url"/></xsl:attribute>
+                               <xsl:value-of select="lang_del"/>
+                       </a></td> 
+               </tr>                                                           
        
+       </xsl:template>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]