Website:Recruits

From MatureAsskickers Wiki

Jump to: navigation, search

« Home

Contents

Recruits Table

The recruits table stores all of the recruit data. This data is used for Session permissions and forum (board) integration.

Data Structure

Fields

Descriptions

recruitid

  • (integer, unique)
  • A unique identification number for the recruit. No other recruit will have the same number and it is used to refer to the recruit from other table's. This value is assigned when the recruit is created and is read-only.
  • Read Permission: recruits.read.recruitid (all)
  • Write Permission: recruits.write.recruitid (none)

datetime_insert

datetime_update

datetime_expire

username

useralias

  • (string, 2-80 characters, alpha-numeric [a-z0-9])
  • This is a unique name for each recruit. No other recruit, recruit or group can use the same name. It is an optional field when adding a new recruit and can be made empty when editing a recruit.
  • Read Permission: recruits.read.useralias (defined)
  • Write Permission: recruits.write.useralias (defined)
  • See Sendmail Aliases

password

email

  • (string, 'recruit@domain.com' format)
  • This is the recruits real email address. It is an optional field when adding a new recruit and can be made empty when editing a recruit.
  • Read Permission: recruits.read.email (defined, self)
  • Write Permission: recruits.write.email (defined, self)
  • See Sendmail Aliases

forum_userid

  • (integer, unique)
  • This is the recruit's forum account's unique id. No two recruits can share the same number. It is an optional field when adding a new recruit and can be made empty when editing a recruit. Setting this field will allow the recruit to login to the website using either the username/password combination described above, or the username/password combination from the forum.
  • Read Permission: recruits.read.forum_userid (defined, self)
  • Write Permission: recruits.write.forum_userid (defined, self)

userpermissions

data

  • (array)
  • This is special array of custom unreserved key value pairs. It is an optional field and any recruits.data.* value can be made empty when editing a recruit.
  • Read Permission: recruits.read.data (all)
  • Write Permission: recruits.write.data (defined, self)
  • See Custom Data

Reading Data

See XML Data

XML

Sample XML output

/xml/recruits.xml

 <?xml version = "1.0" encoding="UTF-8" standalone="yes"?>
 <recruits>
   <recruit id="1">
     <recruitid>1</recruitid>
     <datetime_insert>2006-10-10 07:55:29</datetime_insert>
     <datetime_update>2007-02-19 19:02:14</datetime_update>
     <datetime_expire>2008-08-05 12:00:00</datetime_expire>
     <username>newb</username>
     <useralias>newb</useralias>
     <password>900150983cd24fb0d6963f7d28e17f72</password>
     <email>user@domain.com</email>
     <forum_userid>7</forum_userid>
     <userpermissions>
       <csv><![CDATA[ ftp.read.user,ftp.write.user ]]></csv>
       <ftp.read.user>1</ftp.read.user>
       <ftp.write.user>1</ftp.write.user>
     </userpermissions>
     <data>
       <key>value</key>
       <...>...</...>
     </data>
   </recruit>
   <recruit id="...">
     ...
   </recruit>
 </recruits>

The Request

The following url keys can be used in the HTTP GET request to filter and/or sort the XML.

  • recruitid (default all) - Filter by a single recruitid or CSV of multiple recruitid's.
/xml/recruits.xml?recruitid=1,2,3
  • expired (default 0) - Filter by 0 for non-expired, 1 for expired.
/xml/recruits.xml?expired=1
  • username (default all) - Filter by a single username.
/xml/recruits.xml?username=recruit

Writing Data

HTTP POST

See HTTP POST Data

Adding a recruit (_recruit_add)

A simple example of adding a new recruit.

 <form action="/xml/httppost.xml" method="post">
 <input type="hidden" name="_action" value="_recruit_add">
   username: <input type="text" name="username">
   password: <input type="password" name="password">
   <input type="submit" value="add">
 </form>

Editing a recruit (_recruit_edit)

A simple example of adding a recruit.

 <form action="/xml/httppost.xml" method="post">
 <input type="hidden" name="_action" value="_recruit_edit">
   <input type="hidden" name="recruitid" value="99">
   username: <input type="text" name="username" value="Player">
   password: <input type="password" name="password" value="">
   <input type="submit" value="edit">
 </form>

Deleting a recruit (_recruit_delete)

A simple example of deleting a recruit.

 <form action="/xml/httppost.xml" method="post">
 <input type="hidden" name="_action" value="_recruit_delete">
   <input type="hidden" name="recruitid" value="99">
   <input type="submit" value="delete">
 </form>
Personal tools