<?php
/***************************************************************************
- * Copyright (C) 2003-2008 Polytechnique.org *
+ * Copyright (C) 2003-2009 Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
return $globals->baseurl . '/openid/' . $user->hruid;
}
+function get_idp_xrds_url()
+{
+ global $globals;
+ return $globals->baseurl . '/openid/idp_xrds';
+}
+
function get_user_xrds_url($user)
{
if (is_null($user)) {
'timezone' => null);
}
+function is_trusted_site($user, $url)
+{
+ $res = XDB::query('SELECT COUNT(*)
+ FROM openid_trusted
+ WHERE (user_id = {?} OR user_id IS NULL)
+ AND url = {?}',
+ $user->id(), $url);
+ return $res->fetchOneCell() > 0;
+}
+
+function add_trusted_site($user, $url)
+{
+ XDB::execute("INSERT IGNORE INTO openid_trusted
+ SET user_id={?}, url={?}",
+ $user->id(), $url);
+}
// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
?>
\ No newline at end of file