mgd_list_preferences

(Midgard 1.4.2 'Bifrost')

mgd_list_preferences -- List preferences

Description

object mgd_list_preferences (int [user], string [domain])

Minimum version: Midgard 1.4 (Bifrost)

Lists the preferences in domain domain for user user. If the domain parameter is omitted, all preferences for the user will be listed. If the user parameter is omitted, the preferences for the currently authenticated user will be listed. Preferences are only available when logged in as the user who they're assigned to or as admin.

Returns an object traversable by calling fetch() if successful. Returns FALSE on failure.


<?php
 $user = 17;
 $prefs = mgd_list_preferences( $user );
 if(! $prefs ) {
   echo "Can't list preferences.<br>";
   echo "reason: " . mgd_errstr();
 } else {
   while( $prefs->fetch() ) {
     echo $prefs->domain . "/" . $prefs->name . " : "
          . $prefs->value . "<br>\n";
   }
 }
?>