| Server IP : 217.160.0.169 / Your IP : 216.73.216.220 Web Server : Apache System : Linux info 3.0 #1337 SMP Tue Jan 01 00:00:00 CEST 2000 all GNU/Linux User : u81562609 ( 7464296) PHP Version : 7.2.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /homepages/oneclick/LimeSurvey/2.00.130611/6/scripts/ |
Upload File : |
<?php
function launchUpgradeByCurl($url)
{
$myCurl = curl_init();
curl_setopt($myCurl, CURLOPT_URL, $url);
curl_setopt($myCurl, CURLOPT_HEADER, 0);
curl_setopt($myCurl, CURLOPT_RETURNTRANSFER, 1);
$myData = curl_exec($myCurl);
if(!curl_errno($myCurl)){
$info = curl_getinfo($myCurl);
} else {
print "Curl error: ". curl_error($myCurl);
exit(1);
}
curl_close($myCurl);
exit(0);
}
function passwdGen($length = 8)
{
$str = 'abcdefghijkmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';
for ($i = 0, $passwd = ''; $i < $length; $i++)
$passwd .= xsubstr($str, mt_rand(0, xstrlen($str) - 1), 1);
return $passwd;
}
function xsubstr($str, $start, $length = false, $encoding = 'utf-8')
{
if (is_array($str))
return false;
if (function_exists('mb_substr'))
return mb_substr($str, (int)($start), ($length === false ? xstrlen($str) : (int)($length)), $encoding);
return substr($str, $start, ($length === false ? xstrlen($str) : (int)($length)));
}
function xstrlen($str, $encoding = 'UTF-8')
{
if (is_array($str))
return false;
$str = html_entity_decode($str, ENT_COMPAT, 'UTF-8');
if (function_exists('mb_strlen'))
return mb_strlen($str, $encoding);
return strlen($str);
}
function chmodFileArray($root_dir, $chmodr_settings_params)
{
foreach($chmodr_settings_params as $valor)
{
recursiveChmod($root_dir.$valor);
}
}
function recursiveChmod($path, $filePerm=0777, $dirPerm=0777)
{
if(!file_exists($path))
{
return(FALSE);
}
if(is_file($path))
{
chmod($path, $filePerm);
}
elseif(is_dir($path))
{
$foldersAndFiles = scandir($path);
// Remove "." and ".." from the list
$entries = array_slice($foldersAndFiles, 2);
foreach($entries as $entry)
{
recursiveChmod($path."/".$entry, $filePerm, $dirPerm);
}
chmod($path, $dirPerm);
}
return(TRUE);
}
?>