Exemplo n.º 1
0
}
$sql = "SELECT * FROM {$trans_table} WHERE {$affiliation} AND `td_recur_processed` = 0 and status='A' AND `td_recur_next_date`>=CURDATE()";
$result = mysql_query($sql, $cnn_cs) or dieLog(mysql_errno() . ": " . mysql_error() . "<br>Cannot execute query");
$num = mysql_num_rows($result);
//if($num<1) die("UNF");
$accessDir = "/home/etel/public_html/access/" . $siteInfo['cs_reference_ID'] . "/";
$ht = new htaccess();
// Setting up path of password file
// Setting up path of password file
@mkdir($accessDir);
chdir($accessDir);
$ht->setFPasswd($accessDir . "htpasswd");
//$ht->setFHtaccess($accessDir.".htaccess");
// Setting authenification type
// If you don't set, the default type will be "Basic"
$ht->setAuthType("Basic");
// Setting authenification area name
// If you don't set, the default name will be "Internal Area"
$ht->setAuthName("Members Area");
while ($accountInfo = mysql_fetch_assoc($result)) {
    // Adding user
    $ht->addUser($accountInfo['td_username'], $accountInfo['td_password'], "");
    $tohash .= $accountInfo['td_username'] . ":" . $accountInfo['td_password'];
}
$hash = md5($tohash);
if ($hash == $siteInfo['cs_user_checksum']) {
    die("CUR");
}
$result = mysql_query("UPDATE `cs_company_sites` set `cs_user_checksum`= '{$hash}' WHERE `cs_gatewayId` = " . $_SESSION["gw_id"] . " AND `cs_reference_id` = '{$mt_reference_id}'", $cnn_cs) or dieLog(mysql_errno() . ": " . mysql_error() . "<br>Cannot execute query");
//$ht->addLogin();
die("NEW");
Exemplo n.º 2
0
 public function getHTAccess($settings)
 {
     $htaccess = new htaccess();
     $htaccess->setFPasswd($settings['mi_folder_user_fullpath']);
     $htaccess->setFHtaccess($settings['mi_folder_fullpath']);
     if (!empty($settings['mi_name'])) {
         $htaccess->setAuthName($settings['mi_name']);
     }
     return $htaccess;
 }