Website:Groups

From MatureAsskickers Wiki

Jump to: navigation, search

« Home

Contents

Groups Table

The groups table stores all of the group data. This data is used for Session permissions, HTTP authentication, FTP authentication, and Sendmail aliases.

Data Structure

Fields

Descriptions

groupid

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

datetime_insert

datetime_update

datetime_expire

groupname

hostname

  • (string, 'group.domain.com' format)
  • This is the groups domain or subdomain name. It must either be the current domain, or a sub-domain of the current domain. This value must either be the current domain or a subdomain of the current domain. For example, if the current domain is sub.domain.com, the hostname value must either also be sub.domain.com or something.sub.domain.com. It is a mandatory field when adding a new group and cannot be made empty when editing a group. This value is used for HTTP authentication, FTP authentication and Session permissions.
  • Read Permission: groups.read.hostname (defined, self)
  • Write Permission: groups.write.hostname (defined, self)
  • See Sendmail Aliases

groupalias

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

ftpchroot

httproot

  • (string, 0-255 characters)
  • This is the server's path to the groups HTTP home directory. It is an optional field when adding a new group and can be made empty when editing a group. The path must reside within the jail directory defined in the configuration file. This value is used for HTTP access.
  • Read Permission: groups.read.httproot (defined)
  • Write Permission: groups.write.httproot (defined)

grouppermissions

users

data

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

Reading Data

See XML Data

XML

Sample XML output

/xml/groups.xml

 <?xml version = "1.0" encoding="UTF-8" standalone="yes"?>
 <groups>
   <group id="1">
     <groupid>1</groupid>
     <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>
     <groupname>Team</groupname>
     <hostname>team.domain.com</hostname>
     <groupalias>team</groupalias>
     <ftpchroot>/home/team/html/files</ftpchroot>
     <httproot>/home/team/html</httproot>
     <grouppermissions>
       <csv><![CDATA[ ftp.read.group ]]></csv>
       <ftp.read.group>1</ftp.read.group>
     </grouppermissions>
     <users>
       <user id="1">
         <username>Player1</username>
       </user>
       <user id="2">
         <username>Player2</username>
       </user>
       <user id="3">
         <username>Player3</username>
       </user>
     </users>
     <data>
       <key>value</key>
       <...>...</...>
     </data>
   </group>
   <group id="...">
     ...
   </group>
 </groups>

The Request

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

  • groupid (default all) - Filter by a single groupid or CSV of multiple groupid's.
/xml/groups.xml?groupid=1,2,3
  • userids (default all) - Filter by a single userid or CSV of multiple userid's.
/xml/groups.xml?userids=1,2,3
  • expired (default 0) - Filter by 0 for non-expired, 1 for expired.
/xml/groups.xml?expired=1

Writing Data

HTTP POST

See HTTP POST Data

Adding a group (_group_add)

A simple example of adding a new group.

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

Editing a group (_group_edit)

A simple example of adding a group.

 <form action="/xml/httppost.xml" method="post">
 <input type="hidden" name="_action" value="_group_edit">
   <input type="hidden" name="groupid" value="99">
   groupname: <input type="text" name="groupname" value="Player">
   <input type="submit" value="edit">
 </form>

Deleting a group (_group_delete)

A simple example of deleting a group.

 <form action="/xml/httppost.xml" method="post">
 <input type="hidden" name="_action" value="_group_delete">
   <input type="hidden" name="groupid" value="99">
   <input type="submit" value="delete">
 </form>

Editing a group's users (_group_edit_users)

A simple example of editing a group's users using CSV (comma separated values) of userid's.

 <form action="/xml/httppost.xml" method="post">
 <input type="hidden" name="_action" value="_group_edit_users">
   <input type="hidden" name="groupid" value="99">
   <input type="text" name="users" value="1,2,3">
   <input type="submit" value="edit group users">
 </form>

A simple example of editing a group's users using a select array of userid's.

 <form action="/xml/httppost.xml" method="post">
 <input type="hidden" name="_action" value="_group_edit_users">
   <input type="hidden" name="groupid" value="99">
   <select name="users[]" multiple>
     <option value="1" selected>user 1</option>
     <option value="2">user 2</option>
     <option value="3">user 3</option>
   </select>
   <input type="submit" value="edit group users">
 </form>

Adding a group with users (_group_add, _group_edit_users)

A more complex example of adding a new group and simultaneously assigning the group to an array of users using multiple actions. The group submitting the form will need write permissions for each field or the relative value will be ignored.

 <form action="/xml/httppost.xml" method="post">
 <input type="hidden" name="_action[]" value="_group_add">
 <input type="hidden" name="_action[]" value="_group_edit_users">
   groupname: <input type="text" name="groupname">
   password: <input type="password" name="password">
   <select name="users[]" multiple>
     <option value="1" selected>user 1</option>
     <option value="2">user 2</option>
     <option value="3">user 3</option>
   </select>
   datetime_expire: <input type="text" name="datetime_expire">
   groupalias: <input type="text" name="groupalias">
   ftpchroot: <input type="text" name="ftpchroot">
   httproot: <input type="text" name="httproot">
   grouppermissions: <textarea name="grouppermissions"></textarea>
   <input type="submit" value="add group">
 </form>
Personal tools