Campustream 1.0
A social network MQP for WPI
application/tasks/user.php
Go to the documentation of this file.
00001 <?php
00002 
00003 group('user');
00004 desc('Displays all of the information that we have about a particular user');
00005 
00006 task( 'show', function( $args ) {
00007         
00008         force_execution_on( any_web_server );
00009 
00010         $username = array_shift( $args );
00011         $user = ActiveRecord::find( 'User_Model', "SELECT * FROM users WHERE username = '{$username}'" );
00012 
00013         echo "USER: {$user->username}\n";
00014 
00015         foreach ( $user->columns as $key ) {
00016                 $column = str_pad( "{$key}:", 30 );
00017                 echo " {$column} {$user->$key}\n";
00018         }
00019 
00020 });