2009-07-22 21:33:12 +04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
require_once("FirePHPCore/fb.php");
|
|
|
|
ob_start();
|
|
|
|
|
|
|
|
function ldap_find($connection, $filter, $attributes) {
|
2009-08-06 02:52:01 +04:00
|
|
|
$search = ldap_search($connection, "dc=mozilla", $filter, $attributes);
|
2009-07-22 21:33:12 +04:00
|
|
|
return ldap_get_entries($connection, $search);
|
|
|
|
}
|
|
|
|
|
2009-08-04 02:34:48 +04:00
|
|
|
function in_string($haystack, $needle) {
|
|
|
|
return (strpos($haystack, $needle) !== FALSE);
|
|
|
|
}
|
|
|
|
|
2009-07-22 21:33:12 +04:00
|
|
|
function maketime($slashed_date) {
|
2009-07-24 07:43:52 +04:00
|
|
|
$t = strtotime($slashed_date);
|
2009-07-24 07:08:47 +04:00
|
|
|
if (DEBUG_ON) {
|
2009-07-24 07:43:52 +04:00
|
|
|
fb($t);
|
2009-07-24 07:08:47 +04:00
|
|
|
}
|
2009-07-24 07:43:52 +04:00
|
|
|
return $t;
|
2009-07-22 21:33:12 +04:00
|
|
|
}
|
2009-08-06 02:52:01 +04:00
|
|
|
|
2010-01-12 08:27:59 +03:00
|
|
|
/* Why yes, this name is confusing enough. */
|
|
|
|
function parse_date($date_to_parse) {
|
|
|
|
$p = date_parse($date_to_parse);
|
|
|
|
return mktime(0, 0, 0, $p["month"], $p["day"], $p["year"]);
|
|
|
|
}
|
|
|
|
|
|
|
|
function reformat_date($date_to_parse, $format, $f="date") {
|
|
|
|
return $f($format, parse_date($date_to_parse));
|
|
|
|
}
|
|
|
|
|
2009-08-06 02:52:01 +04:00
|
|
|
function email_to_alias($email) {
|
|
|
|
$alias = explode('@', $email);
|
|
|
|
return $alias[0];
|
|
|
|
}
|