Addressing (in code) users "root" and "Guest" using named contants

0 views
Skip to first unread message

Alexander Obuhovich

unread,
May 18, 2010, 8:30:19 AM5/18/10
to In-Portal Development
System users "root" (id = -1) and "Guest" (id = -2) are using in In-Portal since it's first version. Despite their popularity we always use their IDs in code and not thinking about creating named constants.

I say enough to mystic numbers and propose to create constants:
  • USER_ROOT - for "-1" value
  • USER_GUEST - for "-2" value
I've already did that and replaced all places, where I've found that magic numbers with proposed constants.

Task: http://tracker.in-portal.org/view.php?id=735


--
Best Regards,

http://www.in-portal.com
http://www.alex-time.com
user_constants_core.patch
user_constants_modules.patch

Phil -- wbtc.fr --

unread,
May 18, 2010, 6:13:19 PM5/18/10
to in-por...@googlegroups.com
yes, stop Mystic things is a good idea:-)

2010/5/18 Alexander Obuhovich <aik....@gmail.com>
Reply all
Reply to author
Forward
0 new messages