Merge branch 'master' of git@192.168.100.10:openbsc

This commit is contained in:
Stefan Schmidt 2009-08-13 21:34:02 +02:00
commit 2c2ecdf610
3 changed files with 8 additions and 8 deletions

View File

@ -61,11 +61,8 @@ with web:
UPDATE reg_tokens
SET imsi = ?, extension = ?, tmsi = ?, lac = ?
WHERE subscriber_id = ?
""", (str(subscr['imsi']), subscr['extension'], x['subscriber_id']))
x['imsi'] = str(subscr['imsi'])
x['extension'] = subscr['extension']
x['tmsi'] = subscr['tmsi']
x['lac'] = subscr['lac']
""", (str(subscr['imsi']), subscr['extension'],
subscr['tmsi'], subscr['lac'], x['subscriber_id']))
# add missing web_tokens
with web:

View File

@ -331,6 +331,8 @@ static int authorize_subscriber(struct gsm_loc_updating_operation *loc,
case GSM_AUTH_POLICY_CLOSED:
return subscriber->authorized;
case GSM_AUTH_POLICY_TOKEN:
if (subscriber->authorized)
return subscriber->authorized;
return (subscriber->flags & GSM_SUBSCRIBER_FIRST_CONTACT);
case GSM_AUTH_POLICY_ACCEPT_ALL:
return 1;

View File

@ -30,8 +30,8 @@
#include <openbsc/chan_alloc.h>
#include <openbsc/db.h>
#define TOKEN_SMS_TEXT "HAR 2009 GSM. Please visit http://har2009.gnumonks.org/ to" \
"register. Your IMSI is %s, your auth token is %08X."
#define TOKEN_SMS_TEXT "HAR 2009 GSM. Register at http://har2009.gnumonks.org/ " \
"Your IMSI is %s, auth token is %08X, phone no is %s."
static char *build_sms_string(struct gsm_subscriber *subscr, u_int32_t token)
{
@ -43,7 +43,8 @@ static char *build_sms_string(struct gsm_subscriber *subscr, u_int32_t token)
if (!sms_str)
return NULL;
snprintf(sms_str, len, TOKEN_SMS_TEXT, subscr->imsi, token);
snprintf(sms_str, len, TOKEN_SMS_TEXT, subscr->imsi, token,
subscr->extension);
sms_str[len-1] = '\0';
return sms_str;