source: trunk/install/common.php@ 2

Last change on this file since 2 was 2, checked in by root, 15 years ago

importo il progetto

File size: 1.6 KB
Line 
1<?php
2
3/************************************************************************/
4/* Eleonline */
5/* ============================================ */
6/* Installer was based on Joomla Installer */
7/************************************************************************/
8
9
10//if (file_exists( '../client/config.php' ) && filesize( '../client/config.php' ) > 300) {
11// header( 'Location: ../index.php' );
12// exit();
13//}
14
15error_reporting( E_ALL );
16
17header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
18header ("Pragma: no-cache"); // HTTP/1.0
19
20/**
21* Utility function to return a value from a named array or a specified default
22*/
23define( "_MOS_NOTRIM", 0x0001 );
24define( "_MOS_ALLOWHTML", 0x0002 );
25function mosGetParam( &$arr, $name, $def=null, $mask=0 ) {
26 $return = null;
27 if (isset( $arr[$name] )) {
28 if (is_string( $arr[$name] )) {
29 if (!($mask&_MOS_NOTRIM)) {
30 $arr[$name] = trim( $arr[$name] );
31 }
32 if (!($mask&_MOS_ALLOWHTML)) {
33 $arr[$name] = strip_tags( $arr[$name] );
34 }
35 if (!get_magic_quotes_gpc()) {
36 $arr[$name] = addslashes( $arr[$name] );
37 }
38 }
39 return $arr[$name];
40 } else {
41 return $def;
42 }
43}
44
45function mosMakePassword($length) {
46 $salt = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
47 $len = strlen($salt);
48 $makepass="";
49 mt_srand(10000000*(double)microtime());
50 for ($i = 0; $i < $length; $i++)
51 $makepass .= $salt[mt_rand(0,$len - 1)];
52 return $makepass;
53}
54
55?>
Note: See TracBrowser for help on using the repository browser.