index 621f74bc6b053c1b7b2cd74f67ab9707dc8cde50..8609fab62e3f2236c7a81ea923b6bf1b1e3d5542 100644 (file)
*
* \param string 'class_name' The currently requested class
*/
-function __autoload($class_name) {
+function __gosa_autoload($class_name) {
global $class_mapping, $BASE_DIR;
if ($class_mapping === NULL){
exit;
}
}
+spl_autoload_register('__gosa_autoload');
/*! \brief Checks if a class is available.
$allowed_attributes = array("uid","mail");
$verify_attr = array();
if($config->get_cfg_value("loginAttribute") != ""){
- $tmp = split(",", $config->get_cfg_value("loginAttribute"));
+ $tmp = explode(",", $config->get_cfg_value("loginAttribute"));
foreach($tmp as $attr){
if(in_array($attr,$allowed_attributes)){
$verify_attr[] = $attr;
$dep= "";
- foreach (split(',', $dn) as $rdn){
+ foreach (explode(',', $dn) as $rdn){
$dep = preg_replace("/^[^=]+=/","",$rdn)."/".$dep;
}
*/
function netmask_to_bits($netmask)
{
- list($nm0, $nm1, $nm2, $nm3)= split('\.', $netmask);
+ list($nm0, $nm1, $nm2, $nm3)= explode('.', $netmask);
$res= 0;
for ($n= 0; $n<4; $n++){
}
}
- list($lm,$nt)= split (":", trim($hash));
+ list($lm,$nt)= explode(":", trim($hash));
$attrs['sambaLMPassword']= $lm;
$attrs['sambaNTPassword']= $nt;
/* get the ranges */
$tmp = array('0'=> 1000);
if (preg_match('/posixAccount/', $oc) && $config->get_cfg_value("uidNumberBase") != ""){
- $tmp= split('-',$config->get_cfg_value("uidNumberBase"));
+ $tmp= explode('-',$config->get_cfg_value("uidNumberBase"));
} elseif($config->get_cfg_value("gidNumberBase") != ""){
- $tmp= split('-',$config->get_cfg_value("gidNumberBase"));
+ $tmp= explode('-',$config->get_cfg_value("gidNumberBase"));
}
/* Set hwm to max if not set - for backward compatibility */
}
+/* Mark the occurance of a string with a span */
+function mark($needle, $haystack, $ignorecase= true)
+{
+ $result= "";
+
+ while (preg_match('/^(.*)('.preg_quote($needle).')(.*)$/i', $haystack, $matches)) {
+ $result.= $matches[1]."<span class='mark'>".$matches[2]."</span>";
+ $haystack= $matches[3];
+ }
+
+ return $result.$haystack;
+}
+
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
?>