- 2007-11-11 (Sun) 9:53
- 開発ツール・技術
こちらもいつか使ってみたい、という意味でエントリー。
phpUserClassはユーザー管理に関する機能に特化したライブラリです。ユーザーの認証、ログイン、ユーザーの追加などなど、コミュニティサイトに必要そうな機能をさくっと使うことができます。なお、MySQLと連動させて使います。
実例で見たほうがいいですかね。いくつかコードをご紹介。
if ($user->is_loaded() && !$user->is_active() ) echo 'Please activate your account first';
↑ ユーザーがログインしていて、なおかつ、有効かどうかをチェック。
if ($user->is('customer'))//This will return true if the field `customer` has the value `1`
echo 'Hello, ' . $user->get_property('firstName');
↑ データの取得。簡単そう。
if ( !$user->login($_POST['username'],$_POST['password']) ) echo 'Wrong username and/or password';
↑ 面倒なログイン処理もこんな感じで。
こういうライブラリはそのまま使っても便利ですが、コードを読み解くことで勉強になりそうですね。よろしければどうぞ。
Posted on November 11th, 2007
Comments:1
- Visual Components Systems 07-11-12 (Mon) 4:32
-
ユーザー管理に特化したPHPのライブラリ『phpUserClass』
Trackbacks:0
- Trackback URL for this entry
- http://www.ideaxidea.com/archives/2007/11/phpphpuserclass.html/trackback
- Listed below are links to weblogs that reference
- ユーザー管理に特化したPHPのライブラリ『phpUserClass』 from IDEA*IDEA ~ 百式管理人のライフハックブログ


























