Changeset 997202
- Timestamp:
- 09/26/2014 01:56:53 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
active-directory-integration/trunk/ad-integration.php
r674096 r997202 2137 2137 $parts[1] = strtolower(trim($parts[1])); 2138 2138 } 2139 if (!in_array($parts[1], array('string','list','integer','bool','time','timestamp','octet' ))) {2139 if (!in_array($parts[1], array('string','list','integer','bool','time','timestamp','octet','cn'))) { 2140 2140 $parts[1] = 'string'; 2141 2141 } … … 2203 2203 * Returns formatted value according to attribute type 2204 2204 * 2205 * @param string $type (string, integer, bool, time, timestamp, octet )2205 * @param string $type (string, integer, bool, time, timestamp, octet, cn) 2206 2206 * @param mixed $value 2207 2207 * @return mixed formatted value … … 2225 2225 return date_i18n(get_option('date_format','Y-m-d').' / '.get_option('time_format','H:i:s'), $timestamp, true); 2226 2226 case 'octet': return base64_encode($value); 2227 2228 case 'cn': // Get CN from string 2229 $pos = stripos($value,'cn='); 2230 if ($pos !== false) { 2231 $start = $pos+3; 2232 $foundEnd = false; 2233 $valueLength = strlen($value); 2234 for ($x = $start; $x < $valueLength; $x++) { 2235 if ($value[$x] == ',') { 2236 if ($value[$x-1] !== '\\') { 2237 break; 2238 } 2239 } 2240 } 2241 return stripslashes(substr($value, $start, $x - $start)); 2242 } else { 2243 return ''; 2244 } 2245 2227 2246 } 2228 2247 return $value;
Note: See TracChangeset
for help on using the changeset viewer.