source: trunk/install/common.php@ 388

Last change on this file since 388 was 336, checked in by roby, 4 years ago

Admin: prime modifiche per compatibilità con php 7.4

File size: 1.5 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 $arr[$name] = addslashes( $arr[$name] );
36 }
37 return $arr[$name];
38 } else {
39 return $def;
40 }
41}
42
43function mosMakePassword($length) {
44 $salt = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
45 $len = strlen($salt);
46 $makepass="";
47 mt_srand(10000000*(double)microtime());
48 for ($i = 0; $i < $length; $i++)
49 $makepass .= $salt[mt_rand(0,$len - 1)];
50 return $makepass;
51}
52
53?>
Note: See TracBrowser for help on using the repository browser.