Changeset 13506

Show
Ignore:
Timestamp:
11/19/07 16:27:50 (1 year ago)
Author:
adrenalin
Message:

Added generate passwords feature for account editing.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/midcom/midcom.admin.user/handler/user/edit.php

    r13089 r13506  
    176176        $this->_update_breadcrumb($handler_id); 
    177177         
     178        // Add jQuery Form handling for generating passwords with AJAX 
     179        $_MIDCOM->add_jsfile(MIDCOM_STATIC_URL . '/jQuery/jquery.form-1.0.3.pack.js'); 
     180         
    178181        return true; 
    179182    } 
     
    190193        midgard_admin_asgard_plugin::asgard_header(); 
    191194 
     195        $data['l10n'] =& $this->_l10n; 
    192196        $data['person'] =& $this->_person; 
    193197        $data['controller'] =& $this->_controller; 
    194198        midcom_show_style('midcom-admin-user-person-edit'); 
    195  
     199         
     200        if (isset($_GET['f_submit'])) 
     201        { 
     202            midcom_show_style('midcom-admin-user-generate-passwords'); 
     203        } 
     204         
    196205        midgard_admin_asgard_plugin::asgard_footer(); 
     206    } 
     207     
     208    /** 
     209     * Auto-generate passwords on the fly 
     210     *  
     211     * @access public 
     212     */ 
     213    function _handler_passwords($handler_id, $args, &$data) 
     214    { 
     215        $_MIDCOM->skip_page_style = true; 
     216        return true; 
     217    } 
     218     
     219    /** 
     220     * Auto-generate passwords on the fly 
     221     *  
     222     * @access public 
     223     */ 
     224    function _show_passwords($handler_id, &$data) 
     225    { 
     226        // Show passwords 
     227        $data['l10n'] =& $this->_l10n; 
     228        midcom_show_style('midcom-admin-user-generate-passwords'); 
    197229    } 
    198230} 
  • trunk/midcom/midcom.admin.user/locale/default.en.txt

    r13501 r13506  
    66---STRING add to group 
    77Add to group 
     8---STRINGEND 
     9 
     10---STRING amount 
     11Amount 
    812---STRINGEND 
    913 
     
    6872---STRINGEND 
    6973 
     74---STRING generate 
     75Generate 
     76---STRINGEND 
     77 
     78---STRING generate passwords 
     79Generate passwords 
     80---STRINGEND 
     81 
    7082---STRING go 
    7183Go 
     
    8496---STRINGEND 
    8597 
     98---STRING maximum %s 
     99Maximum %s 
     100---STRINGEND 
     101 
    86102---STRING members 
    87103Members 
     
    90106---STRING midcom.admin.user 
    91107User management 
     108---STRINGEND 
     109 
     110---STRING move %s 
     111Move %s 
    92112---STRINGEND 
    93113 
     
    104124---STRINGEND 
    105125 
     126---STRING password length 
     127Password length 
     128---STRINGEND 
     129 
     130---STRING passwords 
     131Passwords 
     132---STRINGEND 
     133 
    106134---STRING person %s saved 
    107135User %s saved 
     
    110138---STRING postcode 
    111139Postcode 
     140---STRINGEND 
     141 
     142---STRING prevent repeating character 
     143Prevent repeating character 
     144---STRINGEND 
     145 
     146---STRING prevent similar characters 
     147Prevent similar characters 
    112148---STRINGEND 
    113149 
     
    140176---STRINGEND 
    141177 
    142 ---STRING move %
    143 Move %
     178---STRING prevent repeating character
     179Prevent repeating character
    144180---STRINGEND 
    145181 
  • trunk/midcom/midcom.admin.user/locale/default.fi.txt

    r13501 r13506  
    66---STRING add to group 
    77LisÀÀ ryhmÀÀn 
     8---STRINGEND 
     9 
     10---STRING amount 
     11MÀÀrÀ 
    812---STRINGEND 
    913 
     
    6872---STRINGEND 
    6973 
     74---STRING generate 
     75Tee 
     76---STRINGEND 
     77 
    7078---STRING go 
    7179Hae 
     
    8492---STRINGEND 
    8593 
     94---STRING maximum %s 
     95Korkeintaan %s 
     96---STRINGEND 
     97 
    8698---STRING members 
    8799JÀsenet 
     
    90102---STRING midcom.admin.user 
    91103KÀyttÀjien hallinta 
     104---STRINGEND 
     105 
     106---STRING move %s 
     107SiirrÀ %s 
    92108---STRINGEND 
    93109 
     
    104120---STRINGEND 
    105121 
     122---STRING password length 
     123Salasanan pituus 
     124---STRINGEND 
     125 
     126---STRING passwords 
     127Salasanat 
     128---STRINGEND 
     129 
    106130---STRING person %s saved 
    107131KÀyttÀjÀ %s tallennettu 
     
    110134---STRING postcode 
    111135Postinumero 
     136---STRINGEND 
     137 
     138---STRING prevent repeating character 
     139EstÀ samojen merkkien toistuminen 
     140---STRINGEND 
     141 
     142---STRING prevent similar characters 
     143EstÀ samanlaiset merkit 
    112144---STRINGEND 
    113145 
     
    140172---STRINGEND 
    141173 
    142 ---STRING move %
    143 SiirrÀ %s 
     174---STRING prevent repeating character
     175EstÀ samojen merkkien toistuminen 
    144176---STRINGEND 
    145177 
  • trunk/midcom/midcom.admin.user/plugin.php

    r13501 r13506  
    6464                'fixed_args' => array ('edit'), 
    6565                'variable_args' => 1, 
     66            ), 
     67            /** 
     68             * Generate random passwords 
     69             *  
     70             * Match //user-editor/password/ 
     71             */ 
     72            'user_passwords' => array 
     73            ( 
     74                'handler' => array ('midcom_admin_user_handler_user_edit', 'passwords'), 
     75                'fixed_args' => array ('password'), 
    6676            ), 
    6777            /** 
  • trunk/midcom/midcom.admin.user/static/usermgmt.css

    r12849 r13506  
    4141    display: inline !important; 
    4242} 
     43 
     44#midcom_admin_user_passwords 
     45{ 
     46  float: right; 
     47  width: 25em; 
     48} 
     49 
     50#midcom_admin_user_passwords pre 
     51{ 
     52  background-color: #eeeeef; 
     53  padding: 6px; 
     54} 
     55 
     56#midcom_admin_user_passwords label 
     57{ 
     58  display: block; 
     59} 
  • trunk/midcom/midcom.admin.user/style/midcom-admin-user-person-edit.php

    r12696 r13506  
     1<?php 
     2$prefix = $_MIDCOM->get_context_data(MIDCOM_CONTEXT_ANCHORPREFIX); 
     3?> 
    14<h1><?php echo $data['view_title']; ?></h1> 
    2  
     5<div id="midcom_admin_user_passwords"> 
     6    <a href="&(prefix);__mfa/asgard_midcom.admin.user/password/" target="_blank"><?php echo $data['l10n']->get('generate passwords'); ?></a> 
     7</div> 
    38<?php $data['controller']->display_form(); ?> 
     9<script type="text/javascript"> 
     10    // <![CDATA[ 
     11        $j('#midcom_admin_user_passwords a') 
     12            .attr('href', '#') 
     13            .attr('target', '_self') 
     14            .click(function() 
     15            { 
     16                $j(this.parentNode).load('&(prefix);__mfa/asgard_midcom.admin.user/password/?ajax&timestamp=<?php echo time(); ?>'); 
     17            }); 
     18    // ]]> 
     19</script>