( משתמשים)
אנגלית
הירשם
התחברות
לכניסה אוטומטית מהאתר שלך, תחילה עליך להוסיף פונקציה לאתר שלך:
//1. To get token for your users you need to create this function with PHP. function getLoginToken( $string, $api_token ,$domain){ $secret_key = $api_token; $secret_iv = $domain; $output = false; $encrypt_method = "AES-256-CBC"; $key = hash( 'sha256', $secret_key ); $iv = substr( hash( 'sha256', $secret_iv ), 0, 16 ); $output = base64_encode( openssl_encrypt( $string, $encrypt_method, $key, 0, $iv ) ); return $output; } //2. Now you need to create data that includes current time stamp and email,password of your user. $data=[]; $data['email']=$email; //email of your user. $data['password']=$password; //password of this user. $data['time']=time(); //3. Now you get the string of login. if($data['email']=='') { echo 'Please enter email'; } else if($data['password']=='') { echo 'Please enter password'; } else { echo $login_string = getLoginToken(json_encode($data,JSON_UNESCAPED_UNICODE), '' ,'profile'); } //4. now, for every link to your community you can add ?login=$login_string and the user will be auto logged in to your community. //notice: // The user can change manually his password. in this case you will not be able to do auto login. // the link will work only for one hour from creation time.
ionicons-v5-e
ionicons-v5-g
עורך מתקדם
עורך רגיל
פרסם