You've already forked postfixadmin
mirror of
https://github.com/postfixadmin/postfixadmin.git
synced 2025-07-04 19:02:25 +03:00
added user_model.php for user handling added user_controller.php for controlling user missgin view for output. git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@933 a1433add-5e2c-0410-b055-b7f2511e0802
60 lines
1.7 KiB
PHP
60 lines
1.7 KiB
PHP
<?php
|
|
|
|
|
|
class UserController extends Controller {
|
|
|
|
|
|
|
|
public function view($id = NULL) {
|
|
if ($id != NULL) {
|
|
$this->User->load( array( 'where' => array( $this->User->coloumn_id, $id ) ) );
|
|
} else {
|
|
$this->Userload();
|
|
}
|
|
|
|
//function for sending the layout the arg $this->User->Assoc();
|
|
//return $this->User->Assoc();
|
|
}
|
|
public function edit($id) {
|
|
if($id == NULL) {
|
|
$this->errormsg[] = 'The User is nonexistent.';
|
|
return false;
|
|
}
|
|
$this->User->load(array( 'where' => array( $this->User->coloumn_id, $id )));
|
|
//function for sending the layout the arg $this->User->Assoc();
|
|
|
|
//postswtich
|
|
//bla bla smarty stuff for getting the values
|
|
//$this->User->values = array('frit@example.com', 'hased HMAC_MD5 PW', 'Fritz', '/home/fritz/maildir', 51200000, 'fritz', 'example.com', '{[CREATED]}', '{[MODIFIED]}'); {} = Model should replace something, [] = constant not tablenames
|
|
|
|
if( ! $this->User->save() ) {
|
|
$this->errormsg[] = 'The data can't be saved.';
|
|
return false;
|
|
}
|
|
|
|
//redirect to view($id)
|
|
}
|
|
|
|
public function add() {
|
|
|
|
|
|
//only if $_POST of $_GET
|
|
|
|
//bla bla smarty stuff for filling the values
|
|
//$this->User->values = array('frit@example.com', 'hased HMAC_MD5 PW', 'Fritz', '/home/fritz/maildir', 51200000, 'fritz', 'example.com', '{[CREATED]}', '{[MODIFIED]}'); {} = Model should replace something, [] = constant not tablenames
|
|
|
|
if( ! $this->User->save() ) {
|
|
$this->errormsg[] = 'The data can't be saved.';
|
|
return false;
|
|
}
|
|
//redirect to view($id)
|
|
}
|
|
public function delete($id) {
|
|
|
|
}
|
|
public function activate() {
|
|
|
|
}
|
|
public function deactivate() {
|
|
|
|
} |