From a6dc2993e909580bb3af7dc843064fb51c3aa461 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 5 Oct 2010 09:39:17 +0000 Subject: [PATCH] Removed old functions git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19917 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/functions.inc | 66 --------------------------------- 1 file changed, 66 deletions(-) diff --git a/gosa-core/include/functions.inc b/gosa-core/include/functions.inc index b43106386..893d1431d 100644 --- a/gosa-core/include/functions.inc +++ b/gosa-core/include/functions.inc @@ -1981,72 +1981,6 @@ function netmask_to_bits($netmask) } -/*! \brief Recursion helper for gen_id() */ -function recurse($rule, $variables) -{ - $result= array(); - - if (!count($variables)){ - return array($rule); - } - - reset($variables); - $key= key($variables); - $val= current($variables); - unset ($variables[$key]); - - foreach($val as $possibility){ - $nrule= str_replace("{$key}", $possibility, $rule); - $result= array_merge($result, recurse($nrule, $variables)); - } - - return ($result); -} - - -/*! \brief Expands user ID based on possible rules - * - * Unroll given rule string by filling in attributes. - * - * \param string 'rule' The rule string from gosa.conf. - * \param array 'attributes' A dictionary of attribute/value mappings - * \return string Expanded string, still containing the id keyword. - */ -function expand_id($rule, $attributes) -{ - /* Check for id rule */ - if(preg_match('/^id(:|#|!)\d+$/',$rule)){ - return (array("{$rule}")); - } - - /* Check for clean attribute */ - if (preg_match('/^%[a-zA-Z0-9]+$/', $rule)){ - $rule= preg_replace('/^%/', '', $rule); - $val= rewrite(str_replace(' ', '', strtolower($attributes[$rule]))); - return (array($val)); - } - - /* Check for attribute with parameters */ - if (preg_match('/^%[a-zA-Z0-9]+\[[0-9-]+\]$/', $rule)){ - $param= preg_replace('/^[^[]+\[([^]]+)]$/', '\\1', $rule); - $part= preg_replace('/^%/', '', preg_replace('/\[.*$/', '', $rule)); - $val= rewrite(str_replace(' ', '', strtolower($attributes[$part]))); - $start= preg_replace ('/-.*$/', '', $param); - $stop = preg_replace ('/^[^-]+-/', '', $param); - - /* Assemble results */ - $result= array(); - for ($i= $start; $i<= $stop; $i++){ - $result[]= substr($val, 0, $i); - } - return ($result); - } - - echo "Error in idGenerator string: don't know how to handle rule $rule.\n"; - return (array($rule)); -} - - /*! \brief Convert various data sizes to bytes * * Given a certain value in the format n(g|m|k), where n -- 2.30.2