phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] api class.account_mgr.php, 1.1.2.1, 1.1.2.2 class.adm


From: Joseph Engo <address@hidden>
Subject: [Phpgroupware-cvs] api class.account_mgr.php, 1.1.2.1, 1.1.2.2 class.admin.php, 1.1.2.4, 1.1.2.5 class.msgbox.php, 1.1.1.1.2.1, 1.1.1.1.2.2 core_functions.inc.php, 1.1.1.1.2.2, 1.1.1.1.2.3
Date: Sun, 26 Oct 2003 04:57:29 +0000

Update of /cvsroot/phpgroupware/api
In directory subversions:/tmp/cvs-serv3868/api

Modified Files:
      Tag: proposal-branch
        class.account_mgr.php class.admin.php class.msgbox.php 
        core_functions.inc.php 
Log Message:
Created the admin view account and add account screens


Index: class.msgbox.php
===================================================================
RCS file: /cvsroot/phpgroupware/api/class.msgbox.php,v
retrieving revision 1.1.1.1.2.1
retrieving revision 1.1.1.1.2.2
diff -C2 -d -r1.1.1.1.2.1 -r1.1.1.1.2.2
*** class.msgbox.php    23 Oct 2003 20:27:53 -0000      1.1.1.1.2.1
--- class.msgbox.php    26 Oct 2003 04:57:27 -0000      1.1.1.1.2.2
***************
*** 46,50 ****
                        $this->data[] = $args;
                        */
!                       $text = htmlentities($text);
                        switch ($type)
                        {
--- 46,53 ----
                        $this->data[] = $args;
                        */
! 
!                       // FIXME: This seems to create problems with putting 
things like " in the string
! //                    $text = htmlentities($text);
! 
                        switch ($type)
                        {

Index: core_functions.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/api/core_functions.inc.php,v
retrieving revision 1.1.1.1.2.2
retrieving revision 1.1.1.1.2.3
diff -C2 -d -r1.1.1.1.2.2 -r1.1.1.1.2.3
*** core_functions.inc.php      25 Oct 2003 18:29:22 -0000      1.1.1.1.2.2
--- core_functions.inc.php      26 Oct 2003 04:57:27 -0000      1.1.1.1.2.3
***************
*** 94,98 ****
                                if(file_exists($filename))
                                {
!                               require_once($filename);
                                        if(class_exists($class))
                                        {
--- 94,99 ----
                                if(file_exists($filename))
                                {
!                                       require_once($filename);
! 
                                        if(class_exists($class))
                                        {
***************
*** 317,321 ****
                                                                        $msg = 
lang($msg);
                                                                }
!                                                               
$GLOBALS['msgbox']->add($msg.' "'.$key.'"',$line,$file, 'fatal');
                                                        }
                                        }                               
--- 318,322 ----
                                                                        $msg = 
lang($msg);
                                                                }
!                                                               
$GLOBALS['msgbox']->add($msg.' "'.$key.'"  ' . "$file:$line",$line,$file, 
'fatal');
                                                        }
                                        }                               

Index: class.account_mgr.php
===================================================================
RCS file: /cvsroot/phpgroupware/api/Attic/class.account_mgr.php,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -d -r1.1.2.1 -r1.1.2.2
*** class.account_mgr.php       26 Oct 2003 02:16:53 -0000      1.1.2.1
--- class.account_mgr.php       26 Oct 2003 04:57:27 -0000      1.1.2.2
***************
*** 2,6 ****
        class api_account_mgr
        {
!               function show_accounts()
                {
                        $GLOBALS['phpgw']->add_xsl('api.account_mgr');
--- 2,27 ----
        class api_account_mgr
        {
!               function api_account_mgr()
!               {
!                       $appmenu[] = array(
!                               'title' => 'Add User',
!                               'op'    => 'api.account_mgr.create',
!                       );
!                       $appmenu[] = array(
!                               'title' => 'Show Users',
!                               'op'    => 'api.account_mgr.show',
!                       );
!                       $appmenu[] = array(
!                               'title' => 'Add Group',
!                               'op'    => 'api.group_mgr.create',
!                       );
!                       $appmenu[] = array(
!                               'title' => 'Show Groups',
!                               'op'    => 'api.group_mgr.show',
!                       );
!                       
$GLOBALS['phpgw_xml_apinode']->add_node($appmenu,'appmenu');
!               }
! 
!               function show()
                {
                        $GLOBALS['phpgw']->add_xsl('api.account_mgr');
***************
*** 11,14 ****
--- 32,133 ----
                }
  
+               function create()
+               {
+                       $args = new safe_args();
+                       $args->set('create_account_submit', '##NOTSET##', 
'string');
+                       $args->set('account_lid', '##NOTSET##', 'any');
+                       $args->set('account_firstname', '##NOTSET##', 'any');
+                       $args->set('account_lastname', '##NOTSET##', 'any');
+                       $args->set('account_password', '##NOTSET##', 'any');
+                       $args->set('account_password_confirm', '##NOTSET##', 
'any');
+                       $args = $args->get(func_get_args(),__LINE__,__FILE__);
+ 
+                       $GLOBALS['phpgw']->add_xsl('api.account_mgr');
+ 
+                       $result['add_account'] = array(
+                               'account_lid'       => $args['account_lid'],
+                               'account_firstname' => 
$args['account_firstname'],
+                               'account_lastname'  => $args['account_lastname']
+                       );
+ 
+                       // Yes, this is supposed to be a string, NOT a boolean 
value
+                       if ($args['create_account_submit'] == 'True')
+                       {
+                               if (! strlen($args['account_lid']))
+                               {
+                                       
$result['add_account']['missing_fields']['account_lid'] = True;
+                                       $missing_fields = True;
+                               }
+ 
+                               if (! strlen($args['account_firstname']))
+                               {
+                                       
$result['add_account']['missing_fields']['account_firstname'] = True;
+                                       $missing_fields = True;
+                               }
+ 
+                               if (! strlen($args['account_lastname']))
+                               {
+                                       
$result['add_account']['missing_fields']['account_lastname'] = True;
+                                       $missing_fields = True;
+                               }
+ 
+                               if (! strlen($args['account_password']))
+                               {
+                                       
$result['add_account']['missing_fields']['account_password'] = True;
+                                       $missing_fields = True;
+                               }
+ 
+                               if (! strlen($args['account_password_confirm']))
+                               {
+                                       
$result['add_account']['missing_fields']['account_password_confirm'] = True;
+                                       $missing_fields = True;
+                               }
+                               else if ($args['account_password'] != 
$args['account_password_confirm'])
+                               {
+                                       
$result['add_account']['missing_fields']['account_password']         = True;
+                                       
$result['add_account']['missing_fields']['account_password_confirm'] = True;
+                                       $GLOBALS['msgbox']->add(lang('The 
passwords you entered do not match'),__LINE__,__FILE__, 'notice');
+ 
+                               }
+                               else
+                               {
+                                       // FIXME: This hasn't been tested yet
+                                       
sanitize($args['account_password'],'password');
+                               }
+ 
+                               if ($missing_fields)
+                               {
+                                       $GLOBALS['msgbox']->add(lang('You 
forgot to enter some of the required fields. The missing fields have been 
marked with a *'),__LINE__,__FILE__, 'notice');
+                               }
+                               else
+                               {
+                                       $args['account_type']    = 'u';
+                                       $args['account_status']  = 'A';
+                                       $args['account_expires'] = 
gmmktime(23,59,59,12,30,2037);
+ 
+                                       if 
($GLOBALS['phpgw']->accounts->create($args))
+                                       {
+                                               
$GLOBALS['msgbox']->add(lang('Account has been created 
successfully'),__LINE__,__FILE__, 'notice');
+                                               unset($result);
+                                       }
+                               }
+ 
+                       }
+                       return $result;
+               }
+ 
+               function view()
+               {
+                       $args = new safe_args();
+                       $args->set('account_id', '##NOTSET##', 'int');
+                       $args = $args->get(func_get_args(),__LINE__,__FILE__);
+                       $GLOBALS['phpgw']->add_xsl('api.account_mgr');
+ 
+                       $args['account']        = $args['account_id'];
+                       $accounts               = 
CreateObject('api_accounts',$args);
+                       $result['view_account'] = $accounts->data;
+ 
+                       return $result;
+               }
        }
  

Index: class.admin.php
===================================================================
RCS file: /cvsroot/phpgroupware/api/Attic/class.admin.php,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -C2 -d -r1.1.2.4 -r1.1.2.5
*** class.admin.php     26 Oct 2003 02:16:53 -0000      1.1.2.4
--- class.admin.php     26 Oct 2003 04:57:27 -0000      1.1.2.5
***************
*** 25,33 ****
                        $appmenu[] = array(
                                'title' => 'Add User',
!                               'op'    => 'api.admin.adduser',
                        );
                        $appmenu[] = array(
                                'title' => 'Show Users',
!                               'op'    => 'api.account_mgr.show_accounts',
                        );
                        $appmenu[] = array(
--- 25,41 ----
                        $appmenu[] = array(
                                'title' => 'Add User',
!                               'op'    => 'api.account_mgr.create',
                        );
                        $appmenu[] = array(
                                'title' => 'Show Users',
!                               'op'    => 'api.account_mgr.show',
!                       );
!                       $appmenu[] = array(
!                               'title' => 'Add Group',
!                               'op'    => 'api.group_mgr.create',
!                       );
!                       $appmenu[] = array(
!                               'title' => 'Show Groups',
!                               'op'    => 'api.group_mgr.show',
                        );
                        $appmenu[] = array(
***************
*** 39,42 ****
--- 47,51 ----
                        return $result;
                }
+ 
                function adduser ()
                {





reply via email to

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