double auth g1billet API

This commit is contained in:
qo-op 2020-06-09 21:45:18 +02:00
parent b895261c94
commit b5dd23ac71
4 changed files with 10 additions and 9 deletions

View File

@ -143,17 +143,16 @@ function sms_uid2key (){
fi
# Search fo duplicate
DUP=$(grep -Rwl "$ASKWALLET" /home/$YOU/.zen/g1sms/*/_uidname 2>/dev/null | cut -f 6 -d '/')
if [[ "$DUP" != "" && "$DUP" != "$PHONE" ]]; then
sms_SEND "$ADMINPHONE" "ADMIN! INFO: $PHONE prend le même $ASKWALLET, que $DUP"
sms_SEND "$DUP" "Vous devez savoir que $ASKWALLET est associé à un autre téléphone que le votre également!"
fi
###########################################################
# FIND ASKWALLET into wallets, wallest_swarm OR duniter (silkaj)
DESTMEM="$VIRDEST"
# SEARCH IN WALLETS
LOCAL=$(grep -Rwl "$ASKWALLET" /home/$YOU/.zen/g1sms/*/_uidna 2>/dev/null | cut -f 6 -d '/')
if [[ "$LOCAL" != "" && "$LOCAL" != "$PHONE" ]]; then
sms_SEND "$ADMINPHONE" "ADMIN! INFO: $PHONE prend le même $ASKWALLET, que $LOCAL"
sms_SEND "$LOCAL" "Sachez que $ASKWALLET est associé à un autre téléphone que le votre également!"
fi
if [[ "$LOCAL" != "" ]]; then
# LOCAL G1sms account
DESTRIB=$(cat /home/$YOU/.zen/g1sms/$LOCAL/_pub)

View File

@ -40,11 +40,13 @@ Love Land ENTRANCE CHECKING
# /home/$YOU/.zen/astroport/zen/ipfs_SWARM_refresh.sh
# CHECK FOR request from loveland home page
for hashfile in /tmp/loveland_entrance/*; do
[[ ! -f $hashfile ]] && continue
PP=$(cat $hashfile)
PHONE=$(echo $PP | cut -d '|' -f 1)
# CHECK FOR PHONE NUMBER COHERENCE
[[ ! ${#PHONE} -eq 12 ]] && exit 1
[[ ! ${PHONE:3:1} == "6" && ! ${PHONE:3:1} == "7" ]] && exit 1

View File

@ -1,7 +1,7 @@
<?php
header("Access-Control-Allow-Origin: *");
if ( strlen($_REQUEST['code']) == 4 && strlen($_REQUEST['num']) == 10 ) {
$newNumber = preg_replace('/^0?/', '+33', $_REQUEST['num']);
if ( strlen($_REQUEST['code']) == 4 && strlen($_REQUEST['tel']) == 10 ) {
$newNumber = preg_replace('/^0?/', '+33', $_REQUEST['tel']);
$pinfile = '/tmp/'.$newNumber.'.PIN.auth';

View File

@ -1,7 +1,7 @@
<?php
header("Access-Control-Allow-Origin: *");
if (strlen($_REQUEST['num']) == 10 ) {
$newNumber = preg_replace('/^0?/', '+33', $_REQUEST['num']);
if (strlen($_REQUEST['tel']) == 10 ) {
$newNumber = preg_replace('/^0?/', '+33', $_REQUEST['tel']);
$data = '"'.$newNumber.'" "'.$_REQUEST['val'].'"'.PHP_EOL;
$fp = fopen('/tmp/sms.auth.commands', 'w');
fwrite($fp, $data);