openid_trusted -> account_auth_openid
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Mon, 1 Mar 2010 20:32:24 +0000 (21:32 +0100)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Mon, 1 Mar 2010 20:33:00 +0000 (21:33 +0100)
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
modules/admin.php
modules/openid.php
modules/openid/openid.inc.php
upgrade/account/20_naming_convention.sql
upgrade/account/copy_tables.php

index 3bf9b1b..3d07318 100644 (file)
@@ -579,7 +579,7 @@ class AdminModule extends PLModule
 
         // OpenId form {{{
         if (Post::has('del_openid')) {
-            XDB::execute('DELETE FROM  openid_trusted
+            XDB::execute('DELETE FROM  account_auth_openid
                                 WHERE  id = {?}', Post::i('del_openid'));
         }
         // }}}
@@ -626,8 +626,8 @@ class AdminModule extends PLModule
                                              INNER JOIN  profiles AS p ON (ap.pid = p.pid)
                                                   WHERE  ap.uid = {?}', $user->id()));
         $page->assign('openid', XDB::iterator('SELECT  id, url
-                                                 FROM  openid_trusted
-                                                WHERE  user_id = {?}', $user->id()));
+                                                 FROM  account_auth_openid
+                                                WHERE  uid = {?}', $user->id()));
 
         // Displays email redirection and the general profile.
         if ($registered && $redirect) {
index 5818259..619e0c1 100644 (file)
@@ -207,9 +207,9 @@ class OpenidModule extends PLModule
     {
         $page->setTitle('Sites tiers de confiance');
         $page->assign('title', 'Mes sites tiers de confiance pour OpenId');
-        $table_editor = new PLTableEditor('openid/trusted', 'openid_trusted', 'id');
-        $table_editor->set_where_clause('user_id = ' . XDB::escape(S::user()->id()));
-        $table_editor->vars['user_id']['display'] = false;
+        $table_editor = new PLTableEditor('openid/trusted', 'account_auth_openid', 'id');
+        $table_editor->set_where_clause(XDB::format('uid = {?}',  S::user()->id()));
+        $table_editor->vars['uid']['display'] = false;
         $table_editor->describe('url', 'site tiers', true);
         $page->assign('deleteonly', true);
         $table_editor->apply($page, $action, $id);
@@ -219,9 +219,9 @@ class OpenidModule extends PLModule
     {
         $page->setTitle('Sites tiers de confiance');
         $page->assign('title', 'Sites tiers de confiance globaux pour OpenId');
-        $table_editor = new PLTableEditor('admin/openid/trusted', 'openid_trusted', 'id');
-        $table_editor->set_where_clause('user_id IS NULL');
-        $table_editor->vars['user_id']['display'] = false;
+        $table_editor = new PLTableEditor('admin/openid/trusted', 'account_auth_openid', 'id');
+        $table_editor->set_where_clause('uid IS NULL');
+        $table_editor->vars['uid']['display'] = false;
         $table_editor->describe('url', 'site tiers', true);
         $page->assign('readonly', true);
         $table_editor->apply($page, $action, $id);
index 09dfe9c..0e0caa1 100644 (file)
@@ -138,8 +138,8 @@ class OpenId
     {
         $res = XDB::query(
             "SELECT  COUNT(*)
-               FROM  openid_trusted
-              WHERE  (user_id = {?} OR user_id IS NULL) AND url = {?}",
+               FROM  account_auth_openid
+              WHERE  (uid = {?} OR uid IS NULL) AND url = {?}",
             $user->id(), $this->request->trust_root);
         return ($res->fetchOneCell() > 0);
     }
@@ -151,8 +151,8 @@ class OpenId
         $initial_trust = $this->IsEndpointTrusted($user);
         if (!$initial_trust && $trusted && $permanent_trust) {
             XDB::execute(
-                "INSERT IGNORE INTO  openid_trusted
-                                SET  user_id = {?}, url = {?}",
+                "INSERT IGNORE INTO  account_auth_openid
+                                SET  uid = {?}, url = {?}",
                 $user->id(), $this->request->trust_root);
         }
 
index 3e8477b..877a2b0 100644 (file)
@@ -46,4 +46,8 @@ CHANGE COLUMN  user_id pid INT(11) not null;
   ALTER TABLE  profile_medals
 CHANGE COLUMN  uid pid INT(11) not null;
 
+# account
+  ALTER TABLE  account_auth_openid
+CHANGE COLUMN  user_id uid INT(11) not null;
+
 # vim:set ft=mysql:
index 7ddd3f8..5186753 100755 (executable)
@@ -139,7 +139,7 @@ copyTable('#x4dat#.virtual_redirect', 'virtual_redirect');
 copyTable('#x4dat#.watch_nonins', 'watch_nonins');
 copyTable('#x4dat#.watch_promo', 'watch_promo');
 
-copyTable('#x4dat#.openid_trusted', 'openid_trusted', false);
+copyTable('#x4dat#.openid_trusted', 'account_auth_openid', false);
 
 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
 ?>