double auth g1billet API
This commit is contained in:
parent
b895261c94
commit
b5dd23ac71
|
@ -143,17 +143,16 @@ function sms_uid2key (){
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Search fo duplicate
|
# 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)
|
# FIND ASKWALLET into wallets, wallest_swarm OR duniter (silkaj)
|
||||||
DESTMEM="$VIRDEST"
|
DESTMEM="$VIRDEST"
|
||||||
# SEARCH IN WALLETS
|
# SEARCH IN WALLETS
|
||||||
LOCAL=$(grep -Rwl "$ASKWALLET" /home/$YOU/.zen/g1sms/*/_uidna 2>/dev/null | cut -f 6 -d '/')
|
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
|
if [[ "$LOCAL" != "" ]]; then
|
||||||
# LOCAL G1sms account
|
# LOCAL G1sms account
|
||||||
DESTRIB=$(cat /home/$YOU/.zen/g1sms/$LOCAL/_pub)
|
DESTRIB=$(cat /home/$YOU/.zen/g1sms/$LOCAL/_pub)
|
||||||
|
|
|
@ -40,11 +40,13 @@ Love Land ENTRANCE CHECKING
|
||||||
|
|
||||||
# /home/$YOU/.zen/astroport/zen/ipfs_SWARM_refresh.sh
|
# /home/$YOU/.zen/astroport/zen/ipfs_SWARM_refresh.sh
|
||||||
|
|
||||||
|
# CHECK FOR request from loveland home page
|
||||||
for hashfile in /tmp/loveland_entrance/*; do
|
for hashfile in /tmp/loveland_entrance/*; do
|
||||||
[[ ! -f $hashfile ]] && continue
|
[[ ! -f $hashfile ]] && continue
|
||||||
PP=$(cat $hashfile)
|
PP=$(cat $hashfile)
|
||||||
PHONE=$(echo $PP | cut -d '|' -f 1)
|
PHONE=$(echo $PP | cut -d '|' -f 1)
|
||||||
|
|
||||||
|
# CHECK FOR PHONE NUMBER COHERENCE
|
||||||
[[ ! ${#PHONE} -eq 12 ]] && exit 1
|
[[ ! ${#PHONE} -eq 12 ]] && exit 1
|
||||||
[[ ! ${PHONE:3:1} == "6" && ! ${PHONE:3:1} == "7" ]] && exit 1
|
[[ ! ${PHONE:3:1} == "6" && ! ${PHONE:3:1} == "7" ]] && exit 1
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
header("Access-Control-Allow-Origin: *");
|
header("Access-Control-Allow-Origin: *");
|
||||||
if ( strlen($_REQUEST['code']) == 4 && strlen($_REQUEST['num']) == 10 ) {
|
if ( strlen($_REQUEST['code']) == 4 && strlen($_REQUEST['tel']) == 10 ) {
|
||||||
$newNumber = preg_replace('/^0?/', '+33', $_REQUEST['num']);
|
$newNumber = preg_replace('/^0?/', '+33', $_REQUEST['tel']);
|
||||||
|
|
||||||
$pinfile = '/tmp/'.$newNumber.'.PIN.auth';
|
$pinfile = '/tmp/'.$newNumber.'.PIN.auth';
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
header("Access-Control-Allow-Origin: *");
|
header("Access-Control-Allow-Origin: *");
|
||||||
if (strlen($_REQUEST['num']) == 10 ) {
|
if (strlen($_REQUEST['tel']) == 10 ) {
|
||||||
$newNumber = preg_replace('/^0?/', '+33', $_REQUEST['num']);
|
$newNumber = preg_replace('/^0?/', '+33', $_REQUEST['tel']);
|
||||||
$data = '"'.$newNumber.'" "'.$_REQUEST['val'].'"'.PHP_EOL;
|
$data = '"'.$newNumber.'" "'.$_REQUEST['val'].'"'.PHP_EOL;
|
||||||
$fp = fopen('/tmp/sms.auth.commands', 'w');
|
$fp = fopen('/tmp/sms.auth.commands', 'w');
|
||||||
fwrite($fp, $data);
|
fwrite($fp, $data);
|
||||||
|
|
Loading…
Reference in New Issue