1 # ===================================================================== 2 # blogger.getUserInfo: BloggerAPI method. 3 # 4 # Copyright (c) 2007,2009 Carlo Strozzi 5 # 6 # This program is free software; you can redistribute it and/or modify 7 # it under the terms of the GNU General Public License as published by 8 # the Free Software Foundation; version 2 dated June, 1991. 9 # 10 # This program is distributed in the hope that it will be useful, 11 # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 # GNU General Public License for more details. 14 # 15 # You should have received a copy of the GNU General Public License 16 # along with this program; if not, write to the Free Software 17 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 # 19 # ===================================================================== 20 21 # ===================================================================== 22 # List the groups in a specified Blog/Wiki the requesting user is a 23 # member of. With TW, groups are open to everybody in read-mode, and 24 # if any access restrictions ar in effect they apply to single pages, 25 # not to whole groups, therefore any users (even those that are not 26 # listed in 'auth+dat') are members of all the groups in the requested 27 # Blog/Wiki. 28 # 29 # Unlike all other TW methods, this program does not take a 'group' 30 # argument; that only makes sense in the BloggerAPI context, therefore 31 # it only works in RPC2 mode and that's why it does not have a native 32 # TW counterpart. 33 # ===================================================================== 34 35 # ===================================================================== 36 # Local variables and functions 37 # ===================================================================== 38 39 # NONE 40 41 # ===================================================================== 42 # Main program 43 # ===================================================================== 44 45 # Load call arguments. 46 csaGetArgs POST 47 48 tw_dstem = $CSA_ROOT/lib/default 49 50 # Account for the fact that templates are created by the client. 51 CSA_TPL_SAFEPATH = ($CSA_INSTALL/lib $tw_dstem $TMPDIR $CSA_TPL_ROOT 52 $CSA_DOCROOT/$CSA_LANG/$TNS_ATTACH_PUBDIR) 53 54 CSA_EXIT_SCRIPT = $CSA_ROOT/lib/exit-stuff.rc 55 56 ~ ,$TNS_AUTH_GRP, *,editor,* || csaExit.needauth 57 58 # Set template-friendly var names. 59 tpl.var.local.nick = $'tbl_user.u_nick' 60 tpl.var.local.url = $'tbl_user.u_url' 61 tpl.var.local.email = $'tbl_user.u_email' 62 tpl.var.local.last = $'tbl_user.u_sname' 63 tpl.var.local.first = $'tbl_user.u_name' 64 65 csaMkTemp tpl.include.tw.rpc 66 67 cat <<'EOF' > $'tpl.include.tw.rpc' || csaExit.fault 0003 cat 68 69 70 nickname 71 $[tpl.var.local.nick:x] 72 73 74 userid 75 $[CSA_AUTH_USER:x] 76 77 78 url 79 $[tpl.var.local.url:x] 80 81 82 email 83 $[tpl.var.local.email:x] 84 85 86 lastname 87 $[tpl.var.local.last:x] 88 89 90 firstname 91 $[tpl.var.local.first:x] 92 93 94 EOF 95 96 #if (~ $tpl_name tw-*) { 97 # 98 # # Page names beginning with tw-* are reserved for TW use, and usually 99 # # refer to views that do not correspond to actual pages on disk, so 100 # # we need to toggle unapplicable sections in templates. 101 # 102 # tpl.if.tw.ispage = '(::DEL:)' 103 # tpl.fi.tw.ispage = '(:DEL::)' 104 # tpl.if.tw.editor = '(::DEL:)' 105 # tpl.fi.tw.editor = '(:DEL::)' 106 #} 107 108 csaExit.ok 109 110 # End of program.