Changeset 58


Ignore:
Timestamp:
Dec 8, 2007, 5:45:33 PM (16 years ago)
Author:
sebas
Message:

agrego la funcion para borra una cuenta en egw desde alternc.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/alternc/patches/class/m_mail_egw.php

    r44 r58  
    5252        }
    5353
     54        function _deletepop($mail,$dom) {
     55       
     56                if ($this->_del_egw_account($mail,$dom) )
     57                        if (parent::_deletepop($mail,$dom))
     58                                return true;
     59                        else
     60                                return false;
     61                else
     62                        return false;
     63
     64        }
     65
     66
    5467        function _add_egw_account($mail,$dom,$pass) {
    5568
     
    98111        }       
    99112
     113        function _del_egw_account($mail,$dom) {
     114
     115                $res = true;
     116                $domain = explode('.',$dom);
     117                $size = count($domain);
     118                if (  $size >= 3 &&
     119                        $domain[$size-3] == "cta" &&
     120                        $domain[$size-2] == "org" &&
     121                        $domain[$size-1] == "ar" ) {
     122
     123                        $admincli= "/var/alternc/html/i/intranet/intranet.redcta.org.ar/wwws/stable/admin/admin-cli.php";
     124                        $command= "--delete-user";                        // Command to be performed
     125                        $adminuser = $GLOBALS["L_ADMINUSER_EGW"];
     126                        $adminclave = $GLOBALS["L_ADMINCLAVE_EGW"];
     127                        // $account - we use the email address which is extracted from the DB
     128                        $email = $account = $mail ."@" .$dom;
     129
     130                        $go= $admincli ." " .$command ." " .$adminuser ."," .$adminclave .",\"" .$account ."\"" ;
     131                       
     132                        echo ($go);     
     133                        // exit();
     134                        $cod = exec($go);
     135                        if ($cod)
     136                        {
     137                        die ($cod);
     138                                $res = false;
     139                        }       
     140                }
     141                return $res;
     142
     143        }       
     144
    100145}
    101146
Note: See TracChangeset for help on using the changeset viewer.