[pmwiki-users] Regarding Accessing Page via Cookbook
vaibhav.vaish at gmail.com
Mon May 19 01:04:03 CDT 2008
Thanks everybody for help (specially Peter Bowers)! The following
solution works :
A. (Validating User)
1. For most cases validation is against a user having a page edit
permissions. In that case I use ::
RetrieveAuthPage($pagename, $auth, $authprompt=true);
2. For some cases I have a different requirement, I need to check if
a user is a member of some group or not. There I use::
IsAuthorized('id:@group", '', $result);
[[*** I don't understand this function completely, what exactly
are first and second arguments. Also can I use it like case 1?
(Validate a given $auth.) Though this solution works for me. ***]]
B. (Locking Edits)
$page = RetrieveAuthPage($pagename,$auth,$authprompt=true);
$newpage=$page; $newpage["passwdedit"] = "@sysadmin";
[[** Question: For complete locking off, is there something like
"id: -*" ? Though I don't need it here ***]]
C. (Getting formatted HTML)
MarkupToHTML($pagename, $text) should work (need to test it more
though, in the sense that what all markups may fail. This testing will
happen only in due course as my users edit more and more.).
Thanks once more!
On Thu, May 15, 2008 at 12:32 AM, Vaibhav Vaish <vaibhav.vaish at gmail.com> wrote:
> I am planning to use PmWiki as a web interface for teachers who
> would be answering designated questions from students/others.
> [[*** Relevant Details, Skip for quick look at my questions below ***]]
> We have a form where a student may submit a question. For technical
> reasons, the form can't be modified - the back-end script just sends a
> mail to the relevant account. Once a mail is received, I plan to enter
> it using a filter to a *plain text* file, and then use
> http://www.pmwiki.org/wiki/Cookbook/ImportText recipe to integrate it
> into the PmWiki structure. (A metadata file wrt each question: Who
> asked it etc. will also be generated by the mail filter).
> My problem is regarding handling the submitted *answer*. Answer is
> basically developed on this internal Wiki, and then needs to be
> *Published*. On being Published I need to do three actions:
> 1. Generate a web archive of answer. (Can be in the PmWiki setup. Will
> need to lock it down from future edits.)
> 2. Mail back to the Student (The basic objective).
> 3. Generate a Plain text archive of the answer. (This has to be there
> to allow for myriad administrators in case they need to change
> Since I intend to use PmWiki AuthUser system (so that editing
> features aren't availaible to just anyone), it has to be done via a
> For Step 1:: I can do an ImportText on the step 3 generated. Step 2.
> Will be simple as well if I have access to plain text.
> [[*** End Details ***]]
> So my specific questions are:
> A. How can I test auth level of a user? (Specifically, I want to know
> if user is member of a given group.).
> B. How can I lock a page from future edits **from cookbook**?
> C. How can I get **formatted** contents of a page. (Final resort can
> be to use a print kind of template and just wget it, or something like
> that -- but is there a better approach, specifically, not making a
> seperate request to webserver).
> Thanks in advance,
More information about the pmwiki-users