PostfixAdmin - web based virtual user administration interface for Postfix mail servers https://postfixadmin.github.io/postfixadmin/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
1.7 KiB

  1. <?php
  2. class UserController extends Controller {
  3. public function view($id = NULL) {
  4. if ($id != NULL) {
  5. $this->User->load( array( 'where' => array( $this->User->coloumn_id, $id ) ) );
  6. } else {
  7. $this->Userload();
  8. }
  9. //function for sending the layout the arg $this->User->Assoc();
  10. //return $this->User->Assoc();
  11. }
  12. public function edit($id) {
  13. if($id == NULL) {
  14. $this->errormsg[] = 'The User is nonexistent.';
  15. return false;
  16. }
  17. $this->User->load(array( 'where' => array( $this->User->coloumn_id, $id )));
  18. //function for sending the layout the arg $this->User->Assoc();
  19. //postswtich
  20. //bla bla smarty stuff for getting the values
  21. //$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
  22. if( ! $this->User->save() ) {
  23. $this->errormsg[] = "The data can't be saved.";
  24. return false;
  25. }
  26. //redirect to view($id)
  27. }
  28. public function add() {
  29. //only if $_POST of $_GET
  30. //bla bla smarty stuff for filling the values
  31. //$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
  32. if( ! $this->User->save() ) {
  33. $this->errormsg[] = "The data can't be saved.";
  34. return false;
  35. }
  36. //redirect to view($id)
  37. }
  38. public function delete($id) {
  39. }
  40. public function activate() {
  41. }
  42. public function deactivate() {
  43. }