Changeset 946 for trunk/jabberit_messenger/inc/class.fileDefine.inc.php
- Timestamp:
- 06/04/09 10:30:18 (15 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/jabberit_messenger/inc/class.fileDefine.inc.php
r551 r946 11 11 \***************************************************************************/ 12 12 13 class FileDefine13 class fileDefine 14 14 { 15 public final function ldapExternal($pConfLdap) 16 { 17 $file = "confLDAPExternal.php"; 18 $writeFile = "<?php $"."LDAP_EXTERNAL="."\"".base64_encode(serialize($pConfLdap))."\""." ?>"; 19 $this->writeFile($writeFile, $file); 20 } 15 21 16 public final function getParams($pParam)22 public final function ldapInternal($pParam) 17 23 { 18 24 $array_values = explode("\n", $pParam['val']); 25 $file = "confLDAPInternal.php"; 19 26 $infoServer = array(); 20 27 21 28 foreach($array_values as $tmp ) 22 29 { … … 25 32 switch(trim($nvalue[0])) 26 33 { 34 case "JETTI_NAME_JABBERIT" : 35 $infoServer['jabberName'] = $nvalue[1]; 36 break; 37 27 38 case "JETTI_SERVER_LDAP_JABBERIT" : 28 $infoServer['host'] = $nvalue[1];29 39 $infoServer['serverLdap'] = $nvalue[1]; 40 break; 30 41 31 42 case "JETTI_CONTEXT_LDAP_JABBERIT" : 32 $infoServer['context'] = $nvalue[1];33 43 $infoServer['contextLdap'] = $nvalue[1]; 44 break; 34 45 35 46 case "JETTI_USER_LDAP_JABBERIT" : 36 $infoServer['dn'] = $nvalue[1];37 47 $infoServer['user'] = $nvalue[1]; 48 break; 38 49 39 50 case "JETTI_PASSWORD_LDAP_JABBERIT" : 40 $infoServer['passwd'] = $nvalue[1];41 51 $infoServer['password'] = $nvalue[1]; 52 break; 42 53 } 43 54 } 44 55 45 $this->writeFile($infoServer); 56 $writeFile = "<?php $"."LDAP_INTERNAL="."\"".base64_encode(serialize($infoServer))."\""." ?>"; 57 $this->writeFile( $writeFile, $file ); 46 58 } 47 59 48 private final function writeFile($pContent )60 private final function writeFile($pContent, $pfile) 49 61 { 50 51 $filename = dirname(__FILE__).'/conf_Ldap_Photos.php'; 52 $caracter = "$"; 53 $content = "<?php ".$caracter."CONF_SERVER="."\"" . base64_encode(serialize($pContent)) ."\""." ?>"; 54 55 if (!$handle = fopen($filename, 'w')) 56 { 57 echo "Não foi possível abrir o arquivo : \n($filename)"; 62 $filename = dirname(__FILE__).'/'.$pfile; 63 $content = $pContent; 64 65 if ( !$handle = fopen($filename, 'w') ) 58 66 exit; 59 }60 67 61 68 if (fwrite($handle, $content) === FALSE) 62 {63 echo "Não foi possível escrever no arquivo : \n($filename)";64 69 exit; 65 } 66 67 echo "Arquivo : \n $filename \ncriado com sucesso !!"; 70 68 71 fclose($handle); 69 72 }
Note: See TracChangeset
for help on using the changeset viewer.