Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

accountedit.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: accountedit.php 6221 2001-07-20 11:18:28Z jakobn $
5 //
6 // Created on: <23-Oct-2000 17:53:46 bf>
7 //
8 // This source file is part of Exponential Basic, publishing software.
9 //
10 // Copyright (C) 1999-2001 eZ Systems. All rights reserved.
11 //
12 // This program is free software; you can redistribute it and/or
13 // modify it under the terms of the GNU General Public License
14 // as published by the Free Software Foundation; either version 2
15 // of the License, or (at your option) any later version.
16 //
17 // This program is distributed in the hope that it will be useful,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU General Public License for more details.
21 //
22 // You should have received a copy of the GNU General Public License
23 // along with this program; if not, write to the Free Software
24 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, US
25 //
26
27 // include_once( "classes/INIFile.php" );
28 // include_once( "classes/eztemplate.php" );
29 // include_once( "classes/ezlocale.php" );
30 // include_once( "ezuser/classes/ezuser.php" );
31 // include_once( "classes/ezhttptool.php" );
32
33 // include_once( "ezmail/classes/ezmailaccount.php" );
34
35 if( !eZMailAccount::isOwner( eZUser::currentUser(), $AccountID ) )
36 $AccountID = 0;
37
38 if( isset( $Ok ) )
39 {
40 if( $AccountID == 0 )
41 {
42 $account = new eZMailAccount();
43 $account->setUser( eZUser::currentUser() );
44 $account->setIsActive( true );
45 }
46 else
47 {
48 $account = new eZMailAccount( $AccountID );
49 }
50
51 $account->setName( $Name );
52 if( $Password != "" )
53 $account->setPassword( $Password );
54 $account->setLoginName( $Login );
55 $account->setServer( $Server );
56 $account->setServerPort( $Port );
57 if( isset( $DelFromServer ) )
58 $account->setDeleteFromServer( 1 );
59 else
60 $account->setDeleteFromServer( 0 );
61
62 $account->store();
63 eZHTTPTool::header( "Location: /mail/config" );
64 exit();
65 }
66
67 if( isset( $Cancel ) )
68 {
69 eZHTTPTool::header( "Location: /mail/config" );
70 exit();
71 }
72
73
74 $ini =& eZINI::instance( 'site.ini' );
75 $Language = $ini->variable( "eZMailMain", "Language" );
76
77 $t = new eZTemplate( "kernel/ezmail/user/" . $ini->variable( "eZMailMain", "TemplateDir" ),
78 "kernel/ezmail/user/intl/", $Language, "accountedit.php" );
79 $t->setAllStrings();
80
81 $t->set_file( array(
82 "account_edit_page_tpl" => "accountedit.tpl"
83 ) );
84
85 $t->set_var( "current_account_id", $AccountID );
86 $t->set_var( "name_value", "" );
87 $t->set_var( "login_value", "" );
88 $t->set_var( "password_value", "" );
89 $t->set_var( "port_value", "110" );
90 $t->set_var( "server_value" ,"" );
91 $t->set_var( "delete_from_server_checked", "" );
92
93 if( $AccountID != 0 ) // TODO: check that user really is the owner of the account.
94 {
95 $account = new eZMailAccount( $AccountID );
96 $t->set_var( "name_value", htmlspecialchars( $account->name() ) );
97 $t->set_var( "login_value", htmlspecialchars( $account->loginName() ) );
98 $t->set_var( "password_value", htmlspecialchars( $account->password() ) );
99 $t->set_var( "server_value", htmlspecialchars( $account->server() ) );
100 $t->set_var( "port_value", $account->serverPort() );
101 if( $account->deleteFromServer() )
102 $t->set_var( "delete_from_server_checked", "checked" );
103 }
104
105 $t->pparse( "output", "account_edit_page_tpl" );
106
107 ?>
$t
$t
Definition: accountedit.php:77
$ini
if(isset( $Ok)) if(isset( $Cancel)) $ini
Definition: accountedit.php:74
$Language
$Language
Definition: accountedit.php:75
$Password
$Password
Definition: admin/seti.php:21
$Login
$Login
Definition: admin/useredit.php:445
eZHTTPTool\header
static header( $string)
Definition: ezhttptool.php:96
eZMailAccount
Definition: ezmailaccount.php:61
eZMailAccount\isOwner
static isOwner( $user, $accountID)
Definition: ezmailaccount.php:353
eZTemplate
Definition: eztemplate.php:107
eZUser\currentUser
static & currentUser()
Definition: ezuser.php:896
exit
exit
Definition: folder.php:81
$Name
$Name
Definition: polledit.php:250
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.