📄 authority.java
字号:
// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi
// Source File Name: Authority.java
package org.huihoo.openweb.uddiserver.publish;
import java.sql.*;
import org.huihoo.openweb.uddiserver.util.SqlConnection;
public class Authority
{
static Connection con;
public Authority()
{
}
public static String getUser(String authinfo)
{
try
{
if(con == null)
con = SqlConnection.getConnection();
Statement stmt = con.createStatement();
String query = "SELECT userid from authentiTokens where keys = '" + authinfo + "'";
ResultSet rs = stmt.executeQuery(query);
String username;
for(username = null; rs.next(); username = rs.getString("userid"));
stmt.close();
return username;
}
catch(Exception e)
{
e.printStackTrace();
}
return "";
}
public static boolean isAuthorised(String userid, String authinfo)
{
try
{
if(con == null)
con = SqlConnection.getConnection();
Statement stmt = con.createStatement();
String query = "SELECT * from authentiTokens where keys = '" + authinfo + "'";
ResultSet rs = stmt.executeQuery(query);
String password = null;
String username = null;
while(rs.next())
{
username = rs.getString("userid");
password = rs.getString("keys");
}
stmt.close();
if(password == null)
return false;
return userid != null && userid.equals(username);
}
catch(Exception e)
{
e.printStackTrace();
}
return false;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -