]> sipb.mit.edu Git - ikiwiki.git/blob - doc/forum/Can_OpenID_users_be_adminusers__63__.mdwn
response
[ikiwiki.git] / doc / forum / Can_OpenID_users_be_adminusers__63__.mdwn
1 I've just finished an upgrade to 3.141 and am trying to give myself admin rights to play with the new webadmin features.  My login is via OpenID but from reading on the wiki I believe that OpenID users should be able to be granted admin rights.  However I'm obviously doing something wrong as when I click on the "Preferences" link at the top of the page I don't see any admin features.
2
3 My login is: http://adam.shand.net/
4
5 In .ikiwiki/userdb I see:
6
7 > adam@shand.net
8 > email <br>
9 > password <br>
10 > locked_pages <br>
11 > banned <br>
12 > 1229722296 <br>
13 > regdate <br>
14 > http://adam.shand.net/ <br>
15
16 And in my config file I have:
17
18 > adminuser => [qw{http://adam.shand.net/}],
19
20 Any pointers to what I'm doing wrong would be much appreciated.
21
22 Thanks,
23 Adam.
24
25 > This is certianly supposed to work. For example, the admin
26 > user on my ikiwikis is `http://joey.kitenet.net/`
27
28 > The only caveat I know of to make it work is that the 
29 > adminuser openid url has to exactly match the openid url that
30 > ikiwiki sees when you log in. Including any trailing slash,
31 > and the `http://`. --[[Joey]] 
32  
33 >> Hrm, it's not working.  I'm sure I've made a silly mistake somewhere but
34 >> I've looked and looked and just can't find it.  Any suggestions on where
35 >> to look for debugging information would be much appreciated. -- [[Adam]]
36
37 >>> Well, you could use this patch to add debugging info about admin
38 >>> username comparisons:
39
40 <pre>
41 diff --git a/IkiWiki/UserInfo.pm b/IkiWiki/UserInfo.pm
42 index 0bf100a..77b467a 100644
43 --- a/IkiWiki/UserInfo.pm
44 +++ b/IkiWiki/UserInfo.pm
45 @@ -71,6 +71,8 @@ sub userinfo_setall ($$) {
46  sub is_admin ($) {
47         my $user_name=shift;
48  
49 +       print STDERR "is_admin test @{$config{adminuser}} vs $user_name: ".(grep { $_ eq $user_name } @{$config{adminuser}})."\n";
50 +
51         return grep { $_ eq $user_name } @{$config{adminuser}};
52  }
53  
54 </pre>
55
56 >>>> After applying that change to what is probably
57 >>>> `/usr/share/perl5/IkiWiki/UserInfo.pm` on your system, 
58 >>>> when you go to the preferences page it should log in your web server's
59 >>>> error.log, something like this:
60
61         [Wed Jul 08 12:54:35 2009] [error] [client 127.0.1.1] is_admin test http://joey.kitenet.net/ vs http://joey.kitenet.net/: 1
62
63 >>>> So you can see if the two usernames/openids match. If the end is "0",
64 >>>> they don't match. If nothing is logged, you have not enabled the websetup plugin.
65 >>>> If the end if "1" you should see the "Wiki Setup" button, if not the
66 >>>> problem is not in determining if you're an admin, but elsewhere..
67 >>>> --[[Joey]]
68
69 I was being incredibly stupid and missed that websetup is a **plugin** and thus needed to be enabled.  Many thanks for your patient assistance, by helping me eliminate the unlikely it eventually led me to the obvious.  Cheers.  -- [[Adam]]