Changeset 3150
- Timestamp:
- 05/21/12 17:58:20 (12 months ago)
- Location:
- alternc/trunk
- Files:
-
- 8 edited
-
bureau/class/m_bro.php (modified) (2 diffs)
-
bureau/class/m_dom.php (modified) (1 diff)
-
bureau/class/m_ftp.php (modified) (1 diff)
-
bureau/class/m_mail.php (modified) (3 diffs)
-
bureau/class/m_mem.php (modified) (1 diff)
-
bureau/class/m_mysql.php (modified) (2 diffs)
-
bureau/class/m_quota.php (modified) (1 diff)
-
src/export_account.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
alternc/trunk/bureau/class/m_bro.php
r3143 r3150 931 931 $err->log("bro","export_conf"); 932 932 $str="<table border=\"1\"><caption> Browser </caption>\n"; 933 $str=" <browser>\n"; 933 934 $pref=$this->GetPrefs(); 934 935 … … 936 937 foreach ($pref as $k=>$v) { 937 938 if (($i % 2)==0){ 938 $str.=" <tr>\n"; 939 $str.=" <td>".$k."</td><td>".$v."</td>\n"; 940 $str.=" </tr>\n"; 941 } 939 $str.=" <$k>$v</$k>\n"; 940 } 942 941 $i++; 943 942 } 944 $str.=" </table>\n";943 $str.=" </browser>\n"; 945 944 946 945 return $str; -
alternc/trunk/bureau/class/m_dom.php
r3135 r3150 1290 1290 $err->log("dom","export"); 1291 1291 $this->enum_domains(); 1292 $str="<table border=\"1\"><caption>Domaines</caption><tr><th>Domaine</th><th>DNS</th><th>MX</th><th>mail</th></tr> \n";1293 1292 foreach ($this->domains as $d) { 1294 $str .="<tr>";1295 $str.=" <td>".$d."</td>";1293 $str=" <domaines>\n"; 1294 $str.=" <nom>".$d."</nom>\n"; 1296 1295 $this->lock(); 1297 1296 $s=$this->get_domain_all($d); 1298 1297 $this->unlock(); 1299 if(empty($s[ dns])){1298 if(empty($s["dns"])){ 1300 1299 $s[dns]="non"; 1300 }else{ 1301 $s[dns]="oui"; 1301 1302 } 1302 $str.=" <td>".$s[dns]."</td>\n";1303 $str.=" <dns>".$s[dns]."</dns>\n"; 1303 1304 1304 1305 if(empty($s[mx])){ 1305 1306 $s[mx]="non"; 1307 }else{ 1308 $s[mx]="oui"; 1306 1309 } 1307 $str.="<td>".$s[mx]."</td>\n"; 1310 1311 $str.=" <mx>".$s[mx]."</mx>\n"; 1308 1312 1309 1313 if(empty($s[mail])){ 1310 1314 $s[mail]="non"; 1311 1315 } 1312 $str.=" <td>".$s[mail]."</td>\n";1316 $str.=" <mail>".$s[mail]."</mail>\n"; 1313 1317 if (is_array($s[sub])) { 1314 $str.="<table border=\"1\"><th>nom sous domaine</th><th>destination</th><th>type</th><tr>";1315 1316 1318 foreach ($s[sub] as $sub) { 1317 $str.="<tr><td>".$sub["enable"]." </td>"; 1318 $str.="<td>".$sub["dest"]." </td>"; 1319 $str.="<td>".$sub["type"]." </td></tr>"; 1319 $str.=" <subdomain>\n"; 1320 $str.=" <enabled>".$sub["enable"]." </enabled>\n"; 1321 $str.=" <destination>".$sub["dest"]." </destination>\n"; 1322 $str.=" <type>".$sub["type"]." </type>\n"; 1323 $str.=" </subdomain>\n"; 1320 1324 } 1321 1325 1322 $str.="</tr>\n";1323 1326 } 1324 $str.="</table>\n"; 1325 } 1326 $str.="</table>\n"; 1327 $str.=" </domaines>\n"; 1328 } 1327 1329 return $str; 1328 1330 } -
alternc/trunk/bureau/class/m_ftp.php
r3149 r3150 385 385 $err->log("ftp","export"); 386 386 $f=$this->get_list(); 387 $str=" <table border=\"1\"><caption> FTP </caption>\n";387 $str=" <ftp>"; 388 388 foreach ($f as $d=>$v) { 389 $str.=" <tr>\n"; 390 $str.=" <td>".$v["id"]."</td>\n"; 391 $str.=" <td>".($v["encrypted_password"])."</td>\n"; 392 $str.=" <td>".($v["login"])."</td>\n"; 393 $str.=" <td>".($v["dir"])."<td>\n"; 394 $str.=" </tr>\n"; 395 } 396 $str.="</table>\n"; 389 $str.=" <login>".($v["login"])."</login>\n"; 390 $str.=" <password>".($v["encrypted_password"])."</password>\n"; 391 $str.=" <directory>".($v["dir"])."<directory>\n"; 392 } 393 $str.=" </ftp>\n"; 397 394 return $str; 398 395 } -
alternc/trunk/bureau/class/m_mail.php
r3149 r3150 106 106 $this->enum_domain_mails[]=$db->Record; 107 107 } 108 109 108 return $this->enum_domain_mails; 110 109 } … … 196 195 foreach($return2 as $tab => $v){ 197 196 if($v["state"] != true){ 198 print_r($tab);197 //print_r($tab); 199 198 $return["state"]=false; 200 199 $return["error"]="erreur lors du check de la classe $tab"; … … 384 383 } 385 384 386 385 /** 386 * Export the mail information of an account 387 * @return: str, chaine de caractere containing every usefull mail informations. 388 * 389 */ 390 function alternc_export_conf() { 391 global $db,$err,$mail_localbox; 392 $err->log("mail","export"); 393 $domain=$this->enum_domains(); 394 $str="<mail>\n"; 395 $onepop=false; 396 foreach ($domain as $d) { 397 $str.=" <domain>\n <name>".xml_entities($d["domaine"])."</name>\n"; 398 $s=$this->enum_domain_mails($d["id"]); 399 if (count($s)) { 400 while (list($key,$val)=each($s)){ 401 $test=$this->mail_get_details($val['id']); 402 $str.=" <address>\n"; 403 $str.=" <name>".xml_entities($val["address"])."</name>\n"; 404 $str.=" <enabled>".xml_entities($val["enabled"])."</enabled>\n"; 405 if(is_array($test["is_local"])){ 406 $str.=" <islocal>oui</islocal>\n"; 407 $str.=" <path>".$test["is_local"]["path"]."</path>\n"; 408 $str.=" <quota>".$test["is_local"]["quota"]."</quota>\n"; 409 }else{ 410 $str.=" <islocal>non</islocal>\n"; 411 } 412 if(!empty($test["recipients"])){ 413 foreach($test["recipients"] as $recip){ 414 $str.=" <recipients>".$recip."<recipients>\n"; 415 } 416 } 417 if(!empty($test["alias"])){ 418 foreach($test["alias"] as $alias){ 419 $str.=" <alias>".$alias."<alias>\n"; 420 } 421 } 422 $str.=" </address>\n"; 423 } 424 } 425 $str.=" </domain>\n"; 426 } 427 $str.="</mail>\n"; 428 return $str; 429 } 430 387 431 388 432 } /* Class m_mail */ -
alternc/trunk/bureau/class/m_mem.php
r3135 r3150 559 559 global $db,$err; 560 560 $err->log("mem","export"); 561 $str=" <table border=\"1\"><caption > Member </caption>\n";561 $str=" <member>\n"; 562 562 $users=$this->user; 563 $str.=" <tr> <td>".$users["uid"]."</td></tr>\n";564 $str.=" <tr> <td>".$users["login"]."</td></tr>\n";565 $str.=" <tr> <td>".$users["enabled"]."</td></tr>\n";566 $str.=" <tr> <td>".$users["su"]."</td></tr>\n";567 $str.=" <tr> <td>".$users["pass"]."</td></tr>\n";568 $str.=" <tr> <td>".$users["mail"]."</td></tr>\n";569 $str.=" <tr> <td>".$users["created"]."</td></tr>\n";570 $str.=" <tr> <td>".$users["lastip"]."</td></tr>\n";571 $str.=" <tr> <td>".$users["lastlogin"]."</td></tr>\n";572 $str.=" <tr> <td>".$users["lastfail"]."</td></tr>\n";573 $str.=" </table>\n";563 $str.=" <uid>".$users["uid"]."</uid>\n"; 564 $str.=" <login>".$users["login"]."</login>\n"; 565 $str.=" <enabled>".$users["enabled"]."</enabled>\n"; 566 $str.=" <su>".$users["su"]."</su>\n"; 567 $str.=" <password>".$users["pass"]."</password>\n"; 568 $str.=" <mail>".$users["mail"]."</mail>\n"; 569 $str.=" <created>".$users["created"]."</created>\n"; 570 $str.=" <lastip>".$users["lastip"]."</lastip>\n"; 571 $str.=" <lastlogin>".$users["lastlogin"]."</lastlogin>\n"; 572 $str.=" <lastfail>".$users["lastfail"]."</lastfail>\n"; 573 $str.=" </member>\n"; 574 574 return $str; 575 575 } -
alternc/trunk/bureau/class/m_mysql.php
r3138 r3150 769 769 $err->log("mysql","export"); 770 770 $db->query("SELECT login, pass, db, bck_mode, bck_dir, bck_history, bck_gzip FROM db WHERE uid='$cuid';"); 771 $str.="<table border=\"1\"><caption>MyQSL</caption><th>login</th><th>pass</th>";772 771 if ($db->next_record()) { 773 $str.="<tr>\n"; 774 $str.=" <td>".$db->Record["login"]."</td>"; 775 $str.=" <td>".$db->Record["pass"]."</td>"; 776 $str.="</tr>\n"; 772 $str.=" <sql>\n"; 773 $str.=" <login>".$db->Record["login"]."</login>\n"; 774 $str.=" <pass>".$db->Record["pass"]."</pass>\n"; 777 775 do { 778 776 $filename=$tmpdir."/mysql.".$db->Record["db"].".sql.gz"; 779 $str.=" <tr>\n"; 780 $str.=" <td>".($db->Record["db"])."</td>\n"; 781 $str.=" <td>".($db->Record["pass"])."</td>\n"; 777 $str.=" <database>".($db->Record["db"])."</database>\n"; 778 $str.=" <password>".($db->Record["pass"])."</password>\n"; 782 779 if ($s["bck_mode"]!=0) { 783 $str.=" <table>\n"; 784 $str.=" <td>".($db->Record["bck_mode"])."</td>\n"; 785 $str.=" <td>".($db->Record["bck_dir"])."</td>\n"; 786 $str.=" <td>".($db->Record["bck_history"])."</td>\n"; 787 $str.=" <td>".($db->Record["bck_gzip"])."</td>\n"; 788 $str.=" </table>\n"; 780 $str.=" <backup-mode>".($db->Record["bck_mode"])."</backup-mode>\n"; 781 $str.=" <backup-dir>".($db->Record["bck_dir"])."</backup-dir>\n"; 782 $str.=" <backup-history>".($db->Record["bck_history"])."</backup-history>\n"; 783 $str.=" <backup-gzip>".($db->Record["bck_gzip"])."</backup-gzip>\n"; 789 784 } 790 $str.=" </tr>\n";791 785 } while ($db->next_record()); 792 $str.=" </table>\n";786 $str.=" </sql>\n"; 793 787 } 794 788 return $str; … … 816 810 exec ("/usr/bin/mysqldump --defaults-file=/etc/alternc/my.cnf --add-drop-table --allow-keywords -Q -f -q -a -e ".escapeshellarg($db->Record["db"])." |/bin/gzip >".escapeshellarg($filename)); 817 811 } 818 819 820 812 } 821 813 -
alternc/trunk/bureau/class/m_quota.php
r3147 r3150 370 370 * EXPERIMENTAL 'sid' function ;) 371 371 */ 372 function alternc_export_conf( $tmpdir) {372 function alternc_export_conf() { 373 373 global $db,$err; 374 374 $err->log("quota","export"); 375 $str=" <table border=\"1\" ><caption>QUOTA</caption>\n";375 $str=" <quota>"; 376 376 377 377 $q=$this->getquota(); 378 378 foreach ($q as $k=>$v) { 379 $str.=" <tr>\n <td>".($k)."</td>\n"; 380 $str.=" <td>".($v[u])."</td>\n \n"; 381 $str.=" <td>".($v[t])."</td>\n </tr>\n"; 382 } 383 $str.="</table>\n"; 379 $str.=" <$k>\n"; 380 $str.=" <used>".($v["u"])."</used>\n"; 381 $str.=" <total>".($v["t"])."</total>\n"; 382 $str.=" </$k>\n"; 383 } 384 $str.="</quota>\n"; 384 385 return $str; 385 386 } -
alternc/trunk/src/export_account.php
r3132 r3150 73 73 echo $file_conf; 74 74 $file=fopen($file_conf."dump","ab"); 75 fputs($file," dump of ::".$mem->user["login"]."\n");75 fputs($file,"<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?\> \n"); 76 76 77 fputs($file," alternc version:".$L_VERSION."\n\n");78 fputs($file,"< html><body>");77 fputs($file,"<version>:".$L_VERSION."</version>\n"); 78 fputs($file,"<user>".$mem->user["login"]."</user>\n"); 79 79 foreach($conf_user as $string){ 80 80 fputs($file,$string); 81 81 } 82 fputs($file,"</html></body>");82 //fputs($file,"</html></body>"); 83 83 fclose($file); 84 84
Note: See TracChangeset
for help on using the changeset viewer.
