|
|
@@ -2069,33 +2069,53 @@ def ip_pas(raw_ip, type_data = 0):
|
|
|
get_ip = raw_ip
|
|
|
|
|
|
curs.execute(db_change("select data from other where name = 'ip_view'"))
|
|
|
- ip_view = curs.fetchall()
|
|
|
- ip_view = ip_view[0][0] if ip_view else ''
|
|
|
+ db_data = curs.fetchall()
|
|
|
+ ip_view = db_data[0][0] if db_data else ''
|
|
|
ip_view = '' if admin_check(1) == 1 else ip_view
|
|
|
+
|
|
|
+ curs.execute(db_change("select data from other where name = 'user_name_view'"))
|
|
|
+ db_data = curs.fetchall()
|
|
|
+ user_name_view = db_data[0][0] if db_data else ''
|
|
|
+ user_name_view = '' if admin_check(1) == 1 else user_name_view
|
|
|
|
|
|
get_ip = list(set(get_ip))
|
|
|
|
|
|
for raw_ip in get_ip:
|
|
|
change_ip = 0
|
|
|
is_this_ip = ip_or_user(raw_ip)
|
|
|
- if is_this_ip != 0 and ip_view != '':
|
|
|
- try:
|
|
|
- ip = ipaddress.ip_address(raw_ip)
|
|
|
- if type(ip) == ipaddress.IPv6Address:
|
|
|
- ip = ip.exploded
|
|
|
- ip = re.sub(r':([^:]*):([^:]*)$', ':*:*', ip)
|
|
|
+ if is_this_ip != 0:
|
|
|
+ # ip user
|
|
|
+ if ip_view != '':
|
|
|
+ try:
|
|
|
+ ip = ipaddress.ip_address(raw_ip)
|
|
|
+ if type(ip) == ipaddress.IPv6Address:
|
|
|
+ ip = ip.exploded
|
|
|
+ ip = re.sub(r':([^:]*):([^:]*)$', ':*:*', ip)
|
|
|
+ else:
|
|
|
+ ip = ip.exploded
|
|
|
+ ip = re.sub(r'\.([^.]*)\.([^.]*)$', '.*.*', ip)
|
|
|
+
|
|
|
+ # ip = hashlib.sha3_224(bytes(raw_ip, 'utf-8')).hexdigest()
|
|
|
+ # ip = ip[0:4] + '-' + ip[4:8] + '-' + ip[8:12] + '-' + ip[12:16]
|
|
|
+
|
|
|
+ change_ip = 1
|
|
|
+ except:
|
|
|
+ ip = raw_ip
|
|
|
+ else:
|
|
|
+ ip = raw_ip
|
|
|
+ else:
|
|
|
+ # not ip user
|
|
|
+ if ip_view != '':
|
|
|
+ curs.execute(db_change("select data from user_set where id = ? and name = 'sub_user_name'"), [raw_ip])
|
|
|
+ db_data = curs.fetchall()
|
|
|
+ if db_data and db_data[0][0] != '':
|
|
|
+ ip = db_data[0][0]
|
|
|
else:
|
|
|
- ip = ip.exploded
|
|
|
- ip = re.sub(r'\.([^.]*)\.([^.]*)$', '.*.*', ip)
|
|
|
-
|
|
|
- # ip = hashlib.sha3_224(bytes(raw_ip, 'utf-8')).hexdigest()
|
|
|
- # ip = ip[0:4] + '-' + ip[4:8] + '-' + ip[8:12] + '-' + ip[12:16]
|
|
|
+ ip = load_lang('member')
|
|
|
|
|
|
change_ip = 1
|
|
|
- except:
|
|
|
+ else:
|
|
|
ip = raw_ip
|
|
|
- else:
|
|
|
- ip = raw_ip
|
|
|
|
|
|
if type_data == 0 and change_ip == 0:
|
|
|
if is_this_ip == 0:
|