Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Fini_PhpCreate
- Fini_PhpDelete
- Fini_PhpSet
- Fini_PhpGet
- Fini_PhpUnset
- Fini_PhpExist
- */
- function Fini_PhpSet($fPlayer,$tag,$val)
- {
- $abre = fopen($fPlayer, "r+");
- $informacao = fread($abre, filesize($fPlayer));
- fclose($abre);
- $linha = explode("\n", $informacao);
- $percorrer = count($linha);
- $encontrou = 0;
- unlink($fPlayer);
- $escrever = fopen($fPlayer, "w+");
- for($i = 0; $i < $percorrer; $i++)
- {
- $indicativa = explode("=", $linha[$i]);
- if(strcasecmp($indicativa[0],$tag) == 0)
- {
- $linha[$i] = $tag."=".$val;
- $encontrou = 10;
- }
- fwrite($escrever,$linha[$i]."\n");
- }
- if($encontrou != 10)
- {
- fwrite($escrever,$tag."=".$val."\n");
- }
- return fclose($escrever);
- }
- function Fini_PhpGet($fPlayer,$tag)
- {
- $fIni = parse_ini_file($fPlayer);
- return $fIni[$tag];
- }
- function Fini_PhpUnset($fPlayer,$tag)
- {
- $abre = fopen($fPlayer, "r+");
- $informacao = fread($abre, filesize($fPlayer));
- fclose($abre);
- $linha = explode("\n", $informacao);
- $percorrer = count($linha);
- $retornar = 0;
- unlink($fPlayer);
- $escrever = fopen($fPlayer, "w+");
- for($i = 0; $i < $percorrer; $i++)
- {
- $indicativa = explode("=", $linha[$i]);
- if(strcasecmp($indicativa[0],$tag) != 0)
- {
- fwrite($escrever,$linha[$i]."\n");
- }
- }
- fclose($escrever);
- return $retornar;
- }
- function Fini_PhpExist($fpath)
- {
- if(file_exists($fpath))
- return true;
- else
- return false;
- return false;
- }
- function Fini_PhpDelete($fpath)
- {
- return unlink($fpath);;
- }
- function Fini_PhpCreate($fpath)
- {
- $ffini = fopen($fpath, "c+");
- return fclose($ffini);
- }
- function udb_hash($zPass)
- {
- $length = strlen($zPass);
- $pOne = 1;
- $pTwo = 0;
- for($i=0; $i < $length; $i++)
- {
- $pOne = ($pOne + ord($zPass[$i])) % 65521;
- $pTwo = ($pTwo + $pOne) % 65521;
- }
- $pReturn = (($pTwo << 16));
- return $pReturn;
- }
- function gf_encript($zSenha)
- {
- $zLenght = strlen($zSenha);
- for($i = 0; $i < $zLenght; ++$i)
- {
- $sTemp = ord($zSenha[$i]);
- $sTemp += ( 3^$i ) * ( $i % 15 );
- if( $sTemp > (0xff) )
- $sTemp -= 256;
- $zSenha[$i] = chr( $sTemp);
- }
- return $zSenha;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement