added user_list.txt code

This commit is contained in:
gashapwn 2020-11-26 06:53:20 +00:00
parent dcc3b84672
commit 5625e3e2ce
4 changed files with 12 additions and 9 deletions

1
.gitignore vendored
View File

@ -5,3 +5,4 @@ test_*.txt
*/p0.pl
*/p1.pl
*/p2.pl
user_list.txt

8
app.py
View File

@ -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>')

View File

@ -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;
}

View 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%}