Newscoop 4 Cookbook

User

The user object is set at the beginning of the main template based on the session cookies, or if the Login action or Edit user action took place. It can not be initialized by other Newscoop functions. The user object has the following properties:

  • identifier: the user identifier in the Newscoop database
  • name: the user's full name
  • uname: the user's login name
  • gender: "M" or "F"
  • email
  • city
  • str_address: street address
  • state
  • phone
  • fax
  • country: the country name
  • country_code: the country code
  • contact
  • second_phone
  • postal_code
  • employer
  • position
  • interests
  • how
  • languages
  • improvements
  • field1
  • field2
  • field3
  • field4
  • field5
  • text1
  • text2
  • text3
  • pref1
  • pref2
  • pref3
  • pref4
  • title
  • age
  • defined: true if the user object had a valid value
  • logged_in: true if the user was defined and authenticated
  • blocked_from_comments: true if the user was blocked from posting comments
  • subscription: returns the first subscription assigned to this user; unset if the user is a staff member
  • is_admin: true if the user is a staff member, and can therefore log in to the Newscoop administration interface
  • has_permission(<permission_name>): true if the user is a staff member and has been given a specific permission in the Newscoop administration interface