X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Futil.php;h=9f235494bc02dbfb9eb3d0aebf349dd281b4047c;hb=b5659ed85a31093d0e7f6cb58abdaa8410a7a2a6;hp=b7226bd581c2260614e19f7e959904d975cd6ac7;hpb=c51d1521f030cf319ece276dbce25b2408b2e81e;p=quix0rs-gnu-social.git diff --git a/lib/util.php b/lib/util.php index b7226bd581..9f235494bc 100644 --- a/lib/util.php +++ b/lib/util.php @@ -223,6 +223,14 @@ function common_show_header($pagetitle, $callable=NULL, $data=NULL, $headercall= common_element_start('div', array('id' => 'content')); } +# XXX: Refactor w/common_user_error() ? +function common_show_basic_auth_error() { + header('HTTP/1.1 401 Unauthorized'); + header('Content-type: text/plain'); + print("Could not authenticate you.\n"); # exactly what Twitter says + exit(); +} + function common_show_footer() { global $xw, $config; common_element_end('div'); # content div @@ -853,6 +861,16 @@ function common_date_w3dtf($dt) { return date(DATE_W3C, $t); } +function common_date_rfc2822($dt) { + $t = strtotime($dt); + return date("r", $t); +} + +function common_date_iso8601($dt) { + $t = strtotime($dt); + return date("c", $t); +} + function common_redirect($url, $code=307) { static $status = array(301 => "Moved Permanently", 302 => "Found",