1. PHP / Говнокод #21185

    −50

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    50. 50
    51. 51
    52. 52
    53. 53
    54. 54
    55. 55
    56. 56
    57. 57
    /* beg govno_2 */
    
    		$auk_connect = new mysqli($hostname, $username, $password, $auk_database);
    		if ($auk_connect->connect_error) {
    			trigger_error("Connection failed: " . $auk_connect->connect_error);
    		        exit;
    		}
    
    		function getAukcionUserInfo($auk_user_id = null) {
    			global $auk_connect;
    			if (!is_numeric($auk_user_id)) {
    				return false;
    			}
    
    			$query_result = $auk_connect->query('SELECT * FROM `aukcion_users` au INNER JOIN wa_contact wc ON au.`contact_id` = wc.id
    			WHERE
    			wc.`id` = '.$auk_user_id.'');
    			if ($query_result) {
    				$auk_contact_info = $query_result->fetch_array(MYSQLI_ASSOC);
    				return $auk_contact_info;
    			} else {
    				return false;
    			}
    		}
    			// var_dump($_SESSION);
    			if (isset($_SESSION['auth_user'])) {
    				if (isset($_SESSION['auth_user']['id']) && ($_SESSION['auth_user']['id'] > 0)) {
    					$govno_2 = getAukcionUserInfo($_SESSION['auth_user']['id']);
    					if (empty($govno_2)) {
    						// разлогиниваемся с govno
    						//unset($_SESSION['ID_P']);
    					} elseif (isset($govno_2['akk_id']) && is_numeric($govno_2['akk_id'])) {
    						// var_dump('AKK_ID=', $govno_2['akk_id']);
    						$govno_3_result = mysql_query('SELECT akk, id_akk, contakt FROM akk WHERE id_akk = '.$govno_2['akk_id'].'');
    						if ($govno_3_result) {
    							$govno_contact_info = mysql_fetch_assoc($govno_3_result);
    							if (!empty($govno_contact_info)) {
    								$_SESSION['ID_P']=array(
    									1=>$govno_contact_info['id_akk'],
    									2=>md5($_SERVER['REMOTE_ADDR']),
    									3=>$govno_contact_info['contakt']
    								);
    								//var_dump('123123123123123123123');
    							}
    						}
    					}
    				} else {
    					// разлогиниваемся с govno
    					unset($_SESSION['ID_P']);
    				}
    			} else {
    				// разлогиниваемся с govno
    				unset($_SESSION['ID_P']);
    			}
    			//var_dump($_SESSION);
    		//}
    		/* end govno_2 */

    очередной высер

    Запостил: govnokoder2, 14 Сентября 2016

    Комментарии (11) RSS

    Добавить комментарий