added user_list.txt code
This commit is contained in:
parent
dcc3b84672
commit
5625e3e2ce
1
.gitignore
vendored
1
.gitignore
vendored
@ -5,3 +5,4 @@ test_*.txt
|
||||
*/p0.pl
|
||||
*/p1.pl
|
||||
*/p2.pl
|
||||
user_list.txt
|
||||
|
8
app.py
8
app.py
@ -5,7 +5,13 @@ app=Flask(__name__)
|
||||
@app.route("/")
|
||||
def home():
|
||||
app.route('/')
|
||||
return render_template("index.html")
|
||||
|
||||
u_list = [];
|
||||
with open("user_list.txt") as u_file:
|
||||
for line in u_file:
|
||||
u_list.append(line);
|
||||
|
||||
return render_template("index.html", u_list=u_list)
|
||||
|
||||
def home2(name):
|
||||
# app.route('/home2/<name>')
|
||||
|
@ -53,16 +53,11 @@ sub create($){
|
||||
}
|
||||
|
||||
system($cmd);
|
||||
#system("mkdir /home/$username/.ssh");
|
||||
#system("chmod 700 /home/$username/.ssh");
|
||||
system("cat $FULL_PATH/$id.pub > /home/$username/.ssh/authorized_keys");
|
||||
#system("mv $FULL_PATH/$id.pub /home/$username/.ssh/authorized_keys");
|
||||
#system("chmod 600 /home/$username/.ssh/authorized_keys");
|
||||
system("chmod 711 /home/$username");
|
||||
#system("chown $username:$username /home/$username/.ssh");
|
||||
#system("chown $username:$username /home/$username/.ssh/authorized_keys");
|
||||
system("rm $FULL_PATH/$id.ident");
|
||||
system("rm $FULL_PATH/$id.pub");
|
||||
system("echo $username >> user_list.txt");
|
||||
}
|
||||
close FILE;
|
||||
}
|
||||
|
@ -9,8 +9,9 @@
|
||||
<p>git</p>
|
||||
<p>users</p>
|
||||
<ol>
|
||||
<li>gashapwn</li>
|
||||
<li>china probably</li>
|
||||
{% for user in u_list %}
|
||||
<li><a href="~{{user}}">{{user}}</a></li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
</div>
|
||||
{%endblock%}
|
||||
|
Loading…
Reference in New Issue
Block a user