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 */p0.pl
*/p1.pl */p1.pl
*/p2.pl */p2.pl
user_list.txt

8
app.py
View File

@ -5,7 +5,13 @@ app=Flask(__name__)
@app.route("/") @app.route("/")
def home(): def home():
app.route('/') 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): def home2(name):
# app.route('/home2/<name>') # app.route('/home2/<name>')

View File

@ -53,16 +53,11 @@ sub create($){
} }
system($cmd); 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("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("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.ident");
system("rm $FULL_PATH/$id.pub"); system("rm $FULL_PATH/$id.pub");
system("echo $username >> user_list.txt");
} }
close FILE; close FILE;
} }

View File

@ -9,8 +9,9 @@
<p>git</p> <p>git</p>
<p>users</p> <p>users</p>
<ol> <ol>
<li>gashapwn</li> {% for user in u_list %}
<li>china probably</li> <li><a href="~{{user}}">{{user}}</a></li>
{% endfor %}
</ol> </ol>
</div> </div>
{%endblock%} {%endblock%}