Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
dev:gsoc_2008_msg_sms_login [2008/06/07 22:42] ajay_kumar |
dev:gsoc_2008_msg_sms_login [2009/07/06 20:36] (current) |
||
---|---|---|---|
Line 7: | Line 7: | ||
Current login architecture takes into consideration only Sahana Core users, i.e. users who are registered as users in the Sahana system and their record exists in the DB.\\ | Current login architecture takes into consideration only Sahana Core users, i.e. users who are registered as users in the Sahana system and their record exists in the DB.\\ | ||
Public usage for potential news alert broadcasts, or public information IVR via SMS can be implemented following the similar approach. The module is being written keeping this in mind. | Public usage for potential news alert broadcasts, or public information IVR via SMS can be implemented following the similar approach. The module is being written keeping this in mind. | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
===== Files to be added: ===== | ===== Files to be added: ===== | ||
- | - **/ | + | |
+ | - __Purpose of File:__ Main include file for the SMS System calls other files and performs functions | ||
+ | - **/ | ||
+ | - __Purpose of File:__ Handles all communication as a result of SMS input. Parse SMS, Check keywords, Trigger corresponding functions as per SMS input | ||
+ | - **/ | ||
+ | - __Purpose of File:__ Provide SMS Based Session management based on caller ID/mobile number | ||
+ | | ||
+ | - {{dev: | ||
- __Purpose of File:__ Provide SMS Based Authorisation as per Sahana Framework draws from lib_auth.inc | - __Purpose of File:__ Provide SMS Based Authorisation as per Sahana Framework draws from lib_auth.inc | ||
- **/ | - **/ | ||
- __Purpose of File:__ Provide SMS Based Authentication and assigns role to User as per Sahana Framework draws from lib_acl.inc | - __Purpose of File:__ Provide SMS Based Authentication and assigns role to User as per Sahana Framework draws from lib_acl.inc | ||
- | | + | - **/ |
- | - __Purpose of File:__ Provide SMS Based Session management based on caller ID/mobile number | + | |
- | | + | |
- __Purpose of File:__ Errors sent to users as output via SMS on receiving SMS input. | - __Purpose of File:__ Errors sent to users as output via SMS on receiving SMS input. | ||
- | - **/ | ||
- | - __Purpose of File:__ Parse SMS, Check keywords, Trigger corresponding functions as per SMS input | ||
- **/ | - **/ | ||
- __Purpose of File:__ SMS Menu sent to users | - __Purpose of File:__ SMS Menu sent to users | ||
+ | |||
Line 28: | Line 39: | ||
- Add 1 field in table " | - Add 1 field in table " | ||
- | - Add 2 field in table " | + | - Add 1 field in table " |
+ | |||
+ | ** This needs to be done in one of the messaging tables. Still to figure out where and how exactly. | ||
Line 61: | Line 74: | ||
==== Parser Function: ==== | ==== Parser Function: ==== | ||
- | '' | + | <code php> |
- | function _shn_msg_parse_short_message($message){\\ | + | function _shn_msg_parse_short_message($message){ |
- | | + | |
- | | + | |
- | | + | |
- | }'' | + | } |
+ | </ | ||
==== Small Prototype in PHP Demonstrating the Login via SMS to Sahana DB ==== | ==== Small Prototype in PHP Demonstrating the Login via SMS to Sahana DB ==== | ||
- | '' | + | <code php> |
- | <?\\ | + | <? |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | }\\ | + | } |
- | | + | |
- | | + | |
- | echo "Count = $count <br \>"; | + | echo "Count = $count <br \>"; |
- | | + | |
- | echo "< | + | echo "< |
- | | + | |
- | {\\ | + | { |
- | $user = $output[1];\\ | + | $user = $output[1]; |
- | echo "User name: " | + | echo "User name: " |
- | echo "< | + | echo "< |
- | | + | |
- | | + | |
- | | + | |
- | }\\ | + | } |
- | }\\ | + | } |
- | echo " | + | echo " |
- | $pass = $password;\\ | + | $pass = $password; |
- | // | + | // |
- | | + | |
- | | + | |
- | // | + | // |
- | $q = " | + | $q = " |
- | WHERE user_name = ' | + | WHERE user_name = ' |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | }\\ | + | } |
- | | + | |
- | | + | } |
- | | + | |
- | // Create a digest of the password collected from the challenge | + | // Create a digest of the password collected from the challenge |
- | | + | |
- | echo " | + | echo " |
- | // Formulate the SQL to find the user \\ | + | // Formulate the SQL to find the user |
$q = " | $q = " | ||
- | WHERE user_name = ' | + | WHERE user_name = ' |
- | AND password = ' | + | AND password = ' |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | }\\ | + | } |
- | ?>'' | + | ?> |
+ | </ | ||
* --- // | * --- // |