Fix for #768 (If email server is configured, admins can send user passwords, also domains can be denied from registration)

pull/1137/head
Ozzieisaacs 5 years ago
parent 01381488f4
commit 5887f0fe6b

@ -190,10 +190,10 @@ def update_view_configuration():
return view_configuration() return view_configuration()
@admi.route("/ajax/editdomain", methods=['POST']) @admi.route("/ajax/editdomain/<int:allow>", methods=['POST'])
@login_required @login_required
@admin_required @admin_required
def edit_domain(): def edit_domain(allow):
# POST /post # POST /post
# name: 'username', //name of field (column in db) # name: 'username', //name of field (column in db)
# pk: 1 //primary key (record id) # pk: 1 //primary key (record id)
@ -206,14 +206,14 @@ def edit_domain():
return "" return ""
@admi.route("/ajax/adddomain", methods=['POST']) @admi.route("/ajax/adddomain/<int:allow>", methods=['POST'])
@login_required @login_required
@admin_required @admin_required
def add_domain(): def add_domain(allow):
domain_name = request.form.to_dict()['domainname'].replace('*', '%').replace('?', '_').lower() domain_name = request.form.to_dict()['domainname'].replace('*', '%').replace('?', '_').lower()
check = ub.session.query(ub.Registration).filter(ub.Registration.domain == domain_name).first() check = ub.session.query(ub.Registration).filter(ub.Registration.domain == domain_name).filter(ub.Registration.allow == allow).first()
if not check: if not check:
new_domain = ub.Registration(domain=domain_name) new_domain = ub.Registration(domain=domain_name, allow=allow)
ub.session.add(new_domain) ub.session.add(new_domain)
ub.session.commit() ub.session.commit()
return "" return ""
@ -227,18 +227,18 @@ def delete_domain():
ub.session.query(ub.Registration).filter(ub.Registration.id == domain_id).delete() ub.session.query(ub.Registration).filter(ub.Registration.id == domain_id).delete()
ub.session.commit() ub.session.commit()
# If last domain was deleted, add all domains by default # If last domain was deleted, add all domains by default
if not ub.session.query(ub.Registration).count(): if not ub.session.query(ub.Registration).filter(ub.Registration.allow==1).count():
new_domain = ub.Registration(domain="%.%") new_domain = ub.Registration(domain="%.%",allow=1)
ub.session.add(new_domain) ub.session.add(new_domain)
ub.session.commit() ub.session.commit()
return "" return ""
@admi.route("/ajax/domainlist") @admi.route("/ajax/domainlist/<int:allow>")
@login_required @login_required
@admin_required @admin_required
def list_domain(): def list_domain(allow):
answer = ub.session.query(ub.Registration).all() answer = ub.session.query(ub.Registration).filter(ub.Registration.allow == allow).all()
json_dumps = json.dumps([{"domain": r.domain.replace('%', '*').replace('_', '?'), "id": r.id} for r in answer]) json_dumps = json.dumps([{"domain": r.domain.replace('%', '*').replace('_', '?'), "id": r.id} for r in answer])
js = json.dumps(json_dumps.replace('"', "'")).lstrip('"').strip('"') js = json.dumps(json_dumps.replace('"', "'")).lstrip('"').strip('"')
response = make_response(js.replace("'", '"')) response = make_response(js.replace("'", '"'))
@ -605,6 +605,7 @@ def edit_user(user_id):
else: else:
flash(_(u"Found an existing account for this e-mail address."), category="error") flash(_(u"Found an existing account for this e-mail address."), category="error")
return render_title_template("user_edit.html", translations=translations, languages=languages, return render_title_template("user_edit.html", translations=translations, languages=languages,
mail_configured = config.get_mail_server_configured(),
new_user=0, content=content, downloads=downloads, registered_oauth=oauth_check, new_user=0, content=content, downloads=downloads, registered_oauth=oauth_check,
title=_(u"Edit User %(nick)s", nick=content.nickname), page="edituser") title=_(u"Edit User %(nick)s", nick=content.nickname), page="edituser")
if "nickname" in to_save and to_save["nickname"] != content.nickname: if "nickname" in to_save and to_save["nickname"] != content.nickname:
@ -616,11 +617,11 @@ def edit_user(user_id):
return render_title_template("user_edit.html", return render_title_template("user_edit.html",
translations=translations, translations=translations,
languages=languages, languages=languages,
mail_configured=config.get_mail_server_configured(),
new_user=0, content=content, new_user=0, content=content,
downloads=downloads, downloads=downloads,
registered_oauth=oauth_check, registered_oauth=oauth_check,
title=_(u"Edit User %(nick)s", title=_(u"Edit User %(nick)s", nick=content.nickname),
nick=content.nickname),
page="edituser") page="edituser")
if "kindle_mail" in to_save and to_save["kindle_mail"] != content.kindle_mail: if "kindle_mail" in to_save and to_save["kindle_mail"] != content.kindle_mail:
@ -633,6 +634,7 @@ def edit_user(user_id):
flash(_(u"An unknown error occured."), category="error") flash(_(u"An unknown error occured."), category="error")
return render_title_template("user_edit.html", translations=translations, languages=languages, new_user=0, return render_title_template("user_edit.html", translations=translations, languages=languages, new_user=0,
content=content, downloads=downloads, registered_oauth=oauth_check, content=content, downloads=downloads, registered_oauth=oauth_check,
mail_configured=config.get_mail_server_configured(),
title=_(u"Edit User %(nick)s", nick=content.nickname), page="edituser") title=_(u"Edit User %(nick)s", nick=content.nickname), page="edituser")

@ -701,9 +701,13 @@ def speaking_language(languages=None):
# from https://code.luasoftware.com/tutorials/flask/execute-raw-sql-in-flask-sqlalchemy/ # from https://code.luasoftware.com/tutorials/flask/execute-raw-sql-in-flask-sqlalchemy/
def check_valid_domain(domain_text): def check_valid_domain(domain_text):
domain_text = domain_text.split('@', 1)[-1].lower() domain_text = domain_text.split('@', 1)[-1].lower()
sql = "SELECT * FROM registration WHERE :domain LIKE domain;" sql = "SELECT * FROM registration WHERE (:domain LIKE domain and allow = 1);"
result = ub.session.query(ub.Registration).from_statement(text(sql)).params(domain=domain_text).all() result = ub.session.query(ub.Registration).from_statement(text(sql)).params(domain=domain_text).all()
return len(result) if not len(result):
return False
sql = "SELECT * FROM registration WHERE (:domain LIKE domain and allow = 0);"
result = ub.session.query(ub.Registration).from_statement(text(sql)).params(domain=domain_text).all()
return not len(result)
# Orders all Authors in the list according to authors sort # Orders all Authors in the list according to authors sort

@ -19,21 +19,41 @@
$(function() { $(function() {
$("#domain_submit").click(function(event) { $("#domain_allow_submit").click(function(event) {
event.preventDefault(); event.preventDefault();
$("#domain_add").ajaxForm(); $("#domain_add_allow").ajaxForm();
$(this).closest("form").submit(); $(this).closest("form").submit();
$.ajax ({ $.ajax ({
method:"get", method:"get",
url: window.location.pathname + "/../../ajax/domainlist", url: window.location.pathname + "/../../ajax/domainlist/1",
async: true, async: true,
timeout: 900, timeout: 900,
success:function(data) { success:function(data) {
$("#domain-table").bootstrapTable("load", data); $("#domain-allow-table").bootstrapTable("load", data);
} }
}); });
}); });
$("#domain-table").bootstrapTable({ $("#domain-allow-table").bootstrapTable({
formatNoMatches: function () {
return "";
},
striped: false
});
$("#domain_deny_submit").click(function(event) {
event.preventDefault();
$("#domain_add_deny").ajaxForm();
$(this).closest("form").submit();
$.ajax ({
method:"get",
url: window.location.pathname + "/../../ajax/domainlist/0",
async: true,
timeout: 900,
success:function(data) {
$("#domain-deny-table").bootstrapTable("load", data);
}
});
});
$("#domain-deny-table").bootstrapTable({
formatNoMatches: function () { formatNoMatches: function () {
return ""; return "";
}, },
@ -50,14 +70,22 @@ $(function() {
$("#DeleteDomain").modal("hide"); $("#DeleteDomain").modal("hide");
$.ajax({ $.ajax({
method:"get", method:"get",
url: window.location.pathname + "/../../ajax/domainlist", url: window.location.pathname + "/../../ajax/domainlist/1",
async: true, async: true,
timeout: 900, timeout: 900,
success:function(data) { success:function(data) {
$("#domain-table").bootstrapTable("load", data); $("#domain-allow-table").bootstrapTable("load", data);
}
});
$.ajax({
method:"get",
url: window.location.pathname + "/../../ajax/domainlist/0",
async: true,
timeout: 900,
success:function(data) {
$("#domain-deny-table").bootstrapTable("load", data);
} }
}); });
}); });
//triggered when modal is about to be shown //triggered when modal is about to be shown
$("#DeleteDomain").on("show.bs.modal", function(e) { $("#DeleteDomain").on("show.bs.modal", function(e) {

@ -41,22 +41,40 @@
</form> </form>
{% if g.allow_registration %} {% if g.allow_registration %}
<h2>{{_('Allowed domains for registering')}}</h2> <h2>{{_('Allowed domains for registering')}}</h2>
<table class="table table-no-bordered" id="domain-table" data-url="{{url_for('admin.list_domain')}}" data-id-field="id" data-show-header="false" data-editable-mode="inline"> <form id="domain_add_allow" action="{{ url_for('admin.add_domain',allow=1)}}" method="POST">
<div class="form-group required">
<label for="domainname_allow">{{_('Add Domain')}}</label>
<input type="text" class="form-control" name="domainname" id="domainname_allow" >
</div>
<button id="domain_allow_submit" class="btn btn-default">{{_('Add')}}</button>
</form>
<table class="table table-no-bordered" id="domain-allow-table" data-url="{{url_for('admin.list_domain', allow=1)}}" data-id-field="id" data-show-header="false" data-editable-mode="inline">
<thead>
<tr>
<th data-field="domain" id="domain-allow" data-editable-type="text" data-editable-url="{{ url_for('admin.edit_domain', allow = 1)}}" data-editable="true" data-editable-title="{{_('Enter domainname')}}"></th>
<th data-field="id" id="id-allow" data-visible="false"></th>
<th data-align="right" data-formatter="TableActions"></th>
</tr>
</thead>
</table>
<h2>{{_('Denied domains for registering')}}</h2>
<table class="table table-no-bordered" id="domain-deny-table" data-url="{{url_for('admin.list_domain', allow=0)}}" data-id-field="id" data-show-header="false" data-editable-mode="inline">
<thead> <thead>
<tr> <tr>
<th data-field="domain" id="domain" data-editable-type="text" data-editable-url="{{ url_for('admin.edit_domain')}}" data-editable="true" data-editable-title="{{_('Enter domainname')}}"></th> <th data-field="domain" id="domain-deny" data-editable-type="text" data-editable-url="{{ url_for('admin.edit_domain', allow = 0)}}" data-editable="true" data-editable-title="{{_('Enter domainname')}}"></th>
<th data-field="id" id="id" data-visible="false"></th> <th data-field="id" id="id-deny" data-visible="false"></th>
<th data-align="right" data-formatter="TableActions"></th> <th data-align="right" data-formatter="TableActions"></th>
</tr> </tr>
</thead> </thead>
</table> </table>
<form id="domain_add" action="{{ url_for('admin.add_domain')}}" method="POST"> <form id="domain_add_deny" action="{{ url_for('admin.add_domain',allow=0)}}" method="POST">
<div class="form-group required"> <div class="form-group required">
<label for="domainname">{{_('Add Domain')}}</label> <label for="domainname_deny">{{_('Add Domain')}}</label>
<input type="text" class="form-control" name="domainname" id="domainname" > <input type="text" class="form-control" name="domainname" id="domainname_deny" >
</div> </div>
<button id="domain_submit" class="btn btn-default">{{_('Add')}}</button> <button id="domain_deny_submit" class="btn btn-default">{{_('Add')}}</button>
</form> </form>
{% endif %} {% endif %}
</div> </div>
{% endblock %} {% endblock %}

@ -14,15 +14,14 @@
<input type="email" class="form-control" name="email" id="email" value="{{ content.email if content.email != None }}" autocomplete="off"> <input type="email" class="form-control" name="email" id="email" value="{{ content.email if content.email != None }}" autocomplete="off">
</div> </div>
{% if ( g.user and g.user.role_passwd() or g.user.role_admin() ) and not content.role_anonymous() %} {% if ( g.user and g.user.role_passwd() or g.user.role_admin() ) and not content.role_anonymous() %}
{% if g.user and g.user.role_admin() and g.allow_registration and not new_user and not profile %} {% if g.user and g.user.role_admin() and not new_user and not profile and ( mail_configured and content.email if content.email != None %}
<div class="btn btn-default" id="resend_password"><a href="{{url_for('admin.reset_user_password', user_id = content.id) }}">{{_('Reset user Password')}}</a></div> <div class="btn btn-default" id="resend_password"><a href="{{url_for('admin.reset_user_password', user_id = content.id) }}">{{_('Reset user Password')}}</a></div>
{% else %} {% endif %}
<div class="form-group"> <div class="form-group">
<label for="password">{{_('Password')}}</label> <label for="password">{{_('Password')}}</label>
<input type="password" class="form-control" name="password" id="password" value="" autocomplete="off"> <input type="password" class="form-control" name="password" id="password" value="" autocomplete="off">
</div> </div>
{% endif %} {% endif %}
{% endif %}
<div class="form-group"> <div class="form-group">
<label for="kindle_mail">{{_('Kindle E-Mail')}}</label> <label for="kindle_mail">{{_('Kindle E-Mail')}}</label>
<input type="email" class="form-control" name="kindle_mail" id="kindle_mail" value="{{ content.kindle_mail if content.kindle_mail != None }}"> <input type="email" class="form-control" name="kindle_mail" id="kindle_mail" value="{{ content.kindle_mail if content.kindle_mail != None }}">

@ -297,6 +297,7 @@ class Registration(Base):
id = Column(Integer, primary_key=True) id = Column(Integer, primary_key=True)
domain = Column(String) domain = Column(String)
allow = Column(Integer)
def __repr__(self): def __repr__(self):
return u"<Registration('{0}')>".format(self.domain) return u"<Registration('{0}')>".format(self.domain)
@ -332,24 +333,32 @@ def migrate_Database(session):
if not engine.dialect.has_table(engine.connect(), "registration"): if not engine.dialect.has_table(engine.connect(), "registration"):
ReadBook.__table__.create(bind=engine) ReadBook.__table__.create(bind=engine)
conn = engine.connect() conn = engine.connect()
conn.execute("insert into registration (domain) values('%.%')") conn.execute("insert into registration (domain, allow) values('%.%',1)")
session.commit()
try:
session.query(exists().where(Registration.allow)).scalar()
session.commit()
except exc.OperationalError: # Database is not compatible, some columns are missing
conn = engine.connect()
conn.execute("ALTER TABLE registration ADD column 'allow' INTEGER")
conn.execute("update registration set 'allow' = 1")
session.commit() session.commit()
# Handle table exists, but no content # Handle table exists, but no content
cnt = session.query(Registration).count() cnt = session.query(Registration).count()
if not cnt: if not cnt:
conn = engine.connect() conn = engine.connect()
conn.execute("insert into registration (domain) values('%.%')") conn.execute("insert into registration (domain, allow) values('%.%',1)")
session.commit() session.commit()
try: try:
session.query(exists().where(BookShelf.order)).scalar() session.query(exists().where(BookShelf.order)).scalar()
except exc.OperationalError: # Database is not compatible, some rows are missing except exc.OperationalError: # Database is not compatible, some columns are missing
conn = engine.connect() conn = engine.connect()
conn.execute("ALTER TABLE book_shelf_link ADD column 'order' INTEGER DEFAULT 1") conn.execute("ALTER TABLE book_shelf_link ADD column 'order' INTEGER DEFAULT 1")
session.commit() session.commit()
try: try:
create = False create = False
session.query(exists().where(User.sidebar_view)).scalar() session.query(exists().where(User.sidebar_view)).scalar()
except exc.OperationalError: # Database is not compatible, some rows are missing except exc.OperationalError: # Database is not compatible, some columns are missing
conn = engine.connect() conn = engine.connect()
conn.execute("ALTER TABLE user ADD column `sidebar_view` Integer DEFAULT 1") conn.execute("ALTER TABLE user ADD column `sidebar_view` Integer DEFAULT 1")
session.commit() session.commit()

@ -30,15 +30,15 @@
<div id='header_parameters' class='row text-center report-parameters'> <div id='header_parameters' class='row text-center report-parameters'>
<div class="col-xs-6 col-md-4"> <div class="col-xs-6 col-md-4">
<p class='text-justify attribute'><strong>Start Time:</strong> 2019-12-28 15:05:02.169394</p> <p class='text-justify attribute'><strong>Start Time:</strong> 2019-12-29 09:32:57.266265</p>
</div> </div>
<div class="col-xs-6 col-md-4"> <div class="col-xs-6 col-md-4">
<p class='text-justify attribute'><strong>Stop Time:</strong> 2019-12-28 15:36:05.637251</p> <p class='text-justify attribute'><strong>Stop Time:</strong> 2019-12-29 10:08:09.098085</p>
</div> </div>
<div class="col-xs-6 col-md-4"> <div class="col-xs-6 col-md-4">
<p class='text-justify attribute'><strong>Duration:</strong> 0:31:03.467857</p> <p class='text-justify attribute'><strong>Duration:</strong> 0:35:11.831820</p>
</div> </div>
</div> </div>
@ -230,11 +230,11 @@
</td> </td>
<td colspan='6' align='center'>PASS</td> <td colspan='6' align='center'>PASS</td>
</tr> </tr>
<tr class='failClass'> <tr class='passClass'>
<td>test_ebook_convert.test_ebook_convert</td> <td>test_ebook_convert.test_ebook_convert</td>
<td class="text-center">11</td> <td class="text-center">11</td>
<td class="text-center">10</td> <td class="text-center">11</td>
<td class="text-center">1</td> <td class="text-center">0</td>
<td class="text-center">0</td> <td class="text-center">0</td>
<td class="text-center">0</td> <td class="text-center">0</td>
<td class="text-center"> <td class="text-center">
@ -276,15 +276,15 @@
</div> </div>
<div class="text-left pull-left"> <div class="text-left pull-left">
<pre class="text-left">pt3.4: User: name@host.com, Password: 10234 <pre class="text-left">pt3.4: User: name@host.com, Password: 10234
Receiving message from: ('127.0.0.1', 35724) Receiving message from: ('127.0.0.1', 44766)
Message addressed from: name@host.com Message addressed from: name@host.com
Message addressed to: a5@b.com Message addressed to: a5@b.com
Message length : 1 Message length : 42
User: name@host.com, Password: 10234 User: name@host.com, Password: 10234
Receiving message from: ('127.0.0.1', 35726) Receiving message from: ('127.0.0.1', 44768)
Message addressed from: name@host.com Message addressed from: name@host.com
Message addressed to: a1@b.com Message addressed to: a1@b.com
Message length : 2 Message length : 16679
User: name@host.com, Password: 1234</pre> User: name@host.com, Password: 1234</pre>
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>
@ -309,10 +309,10 @@ User: name@host.com, Password: 1234</pre>
</div> </div>
<div class="text-left pull-left"> <div class="text-left pull-left">
<pre class="text-left">pt3.5: User: name@host.com, Password: 10234 <pre class="text-left">pt3.5: User: name@host.com, Password: 10234
Receiving message from: ('127.0.0.1', 35730) Receiving message from: ('127.0.0.1', 44772)
Message addressed from: name@host.com Message addressed from: name@host.com
Message addressed to: a5@b.com Message addressed to: a5@b.com
Message length : 1 Message length : 42
User: name@host.com, Password: 1234</pre> User: name@host.com, Password: 1234</pre>
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>
@ -355,45 +355,42 @@ User: name@host.com, Password: 1234</pre>
</div> </div>
<div class="text-left pull-left"> <div class="text-left pull-left">
<pre class="text-left">pt3.9: User: name@host.com, Password: 10234 <pre class="text-left">pt3.9: User: name@host.com, Password: 10234
Receiving message from: ('127.0.0.1', 35734) Receiving message from: ('127.0.0.1', 44776)
Message addressed from: name@host.com Message addressed from: name@host.com
Message addressed to: a1@b.com Message addressed to: a1@b.com
Message length : 2</pre> Message length : 22311</pre>
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>
</div> </div>
<!--css div popup end--> <!--css div popup end-->
</td> </td>
</tr> </tr>
<tr id='ft3.10' class='none bg-danger'> <tr id='pt3.10' class='hiddenRow bg-success'>
<td> <td>
<div class='testcase'>test_email_only</div> <div class='testcase'>test_email_only</div>
</td> </td>
<td colspan='6'> <td colspan='6'>
<div class="text-center"> <div class="text-center">
<a class="popup_link text-center" onfocus='blur()' onclick="showTestDetail('div_ft3.10')">FAIL</a> <a class="popup_link text-center" onfocus='blur()' onclick="showTestDetail('div_pt3.10')">PASS</a>
</div> </div>
<!--css div popup start--> <!--css div popup start-->
<div id='div_ft3.10' class="popup_window test_output" style="display:none;"> <div id='div_pt3.10' class="popup_window test_output" style="display:none;">
<div class='close_button pull-right'> <div class='close_button pull-right'>
<button type="button" class="close" aria-label="Close" onfocus='this.blur();' <button type="button" class="close" aria-label="Close" onfocus='this.blur();'
onclick="document.getElementById('div_ft3.10').style.display='none'"><span onclick="document.getElementById('div_pt3.10').style.display='none'"><span
aria-hidden="true">&times;</span></button> aria-hidden="true">&times;</span></button>
</div> </div>
<div class="text-left pull-left"> <div class="text-left pull-left">
<pre class="text-left">ft3.10: User: name@host.com, Password: 10234 <pre class="text-left">pt3.10: User: name@host.com, Password: 10234
Receiving message from: ('127.0.0.1', 35736) Receiving message from: ('127.0.0.1', 44778)
Message addressed from: name@host.com Message addressed from: name@host.com
Message addressed to: a5@b.com Message addressed to: a5@b.com
Message length : 1 Message length : 42
User: name@host.com, Password: 10234 User: name@host.com, Password: 10234
Receiving message from: ('127.0.0.1', 35738) Receiving message from: ('127.0.0.1', 44780)
Message addressed from: name@host.com Message addressed from: name@host.com
Message addressed to: a1@b.com Message addressed to: a1@b.com
Message length : 2Traceback (most recent call last): Message length : 17477</pre>
File "/home/matthias/Entwicklung/calibre-web-test/test/test_ebook_convert.py", line 397, in test_email_only
self.assertGreaterEqual(self.email_server.handler.message_size,24256)
AssertionError: 2 not greater than or equal to 24256</pre>
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>
</div> </div>
@ -1287,10 +1284,10 @@ AssertionError: 2 not greater than or equal to 24256</pre>
</div> </div>
<div class="text-left pull-left"> <div class="text-left pull-left">
<pre class="text-left">pt6.1: User: name@host.com, Password: 10234 <pre class="text-left">pt6.1: User: name@host.com, Password: 10234
Receiving message from: ('127.0.0.1', 41832) Receiving message from: ('127.0.0.1', 47328)
Message addressed from: name@host.com Message addressed from: name@host.com
Message addressed to: a1@b.com Message addressed to: a1@b.com
Message length : 2</pre> Message length : 22013</pre>
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>
</div> </div>
@ -1303,121 +1300,111 @@ Message length : 2</pre>
</td> </td>
<td colspan='6' align='center'>PASS</td> <td colspan='6' align='center'>PASS</td>
</tr> </tr>
<tr class='failClass'> <tr class='skipClass'>
<td>test_email_ssl.test_SSL</td> <td>test_email_ssl.test_SSL</td>
<td class="text-center">4</td> <td class="text-center">4</td>
<td class="text-center">0</td> <td class="text-center">2</td>
<td class="text-center">4</td>
<td class="text-center">0</td> <td class="text-center">0</td>
<td class="text-center">0</td> <td class="text-center">0</td>
<td class="text-center">2</td>
<td class="text-center"> <td class="text-center">
<a onclick="showClassDetail('c7', 4)">Detail</a> <a onclick="showClassDetail('c7', 4)">Detail</a>
</td> </td>
</tr> </tr>
<tr id='ft7.1' class='none bg-danger'> <tr id='st7.1' class='none bg-warning'>
<td> <td>
<div class='testcase'>test_SSL_None_setup_error</div> <div class='testcase'>test_SSL_None_setup_error</div>
</td> </td>
<td colspan='6'> <td colspan='6'>
<div class="text-center"> <div class="text-center">
<a class="popup_link text-center" onfocus='blur()' onclick="showTestDetail('div_ft7.1')">FAIL</a> <a class="popup_link text-center" onfocus='blur()' onclick="showTestDetail('div_st7.1')">SKIP</a>
</div> </div>
<!--css div popup start--> <!--css div popup start-->
<div id='div_ft7.1' class="popup_window test_output" style="display:none;"> <div id='div_st7.1' class="popup_window test_output" style="display:none;">
<div class='close_button pull-right'> <div class='close_button pull-right'>
<button type="button" class="close" aria-label="Close" onfocus='this.blur();' <button type="button" class="close" aria-label="Close" onfocus='this.blur();'
onclick="document.getElementById('div_ft7.1').style.display='none'"><span onclick="document.getElementById('div_st7.1').style.display='none'"><span
aria-hidden="true">&times;</span></button> aria-hidden="true">&times;</span></button>
</div> </div>
<div class="text-left pull-left"> <div class="text-left pull-left">
<pre class="text-left">ft7.1: Traceback (most recent call last): <pre class="text-left">st7.1: AsyncIO has no ssl handshake timeout</pre>
File "/home/matthias/Entwicklung/calibre-web-test/test/test_email_ssl.py", line 129, in test_SSL_None_setup_error
self.assertEqual('Failed', ret[-1]['result'])
AssertionError: 'Failed' != 'Started'
- Failed
+ Started</pre>
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>
</div> </div>
<!--css div popup end--> <!--css div popup end-->
</td> </td>
</tr> </tr>
<tr id='ft7.2' class='none bg-danger'> <tr id='st7.2' class='none bg-warning'>
<td> <td>
<div class='testcase'>test_SSL_STARTTLS_setup_error</div> <div class='testcase'>test_SSL_STARTTLS_setup_error</div>
</td> </td>
<td colspan='6'> <td colspan='6'>
<div class="text-center"> <div class="text-center">
<a class="popup_link text-center" onfocus='blur()' onclick="showTestDetail('div_ft7.2')">FAIL</a> <a class="popup_link text-center" onfocus='blur()' onclick="showTestDetail('div_st7.2')">SKIP</a>
</div> </div>
<!--css div popup start--> <!--css div popup start-->
<div id='div_ft7.2' class="popup_window test_output" style="display:none;"> <div id='div_st7.2' class="popup_window test_output" style="display:none;">
<div class='close_button pull-right'> <div class='close_button pull-right'>
<button type="button" class="close" aria-label="Close" onfocus='this.blur();' <button type="button" class="close" aria-label="Close" onfocus='this.blur();'
onclick="document.getElementById('div_ft7.2').style.display='none'"><span onclick="document.getElementById('div_st7.2').style.display='none'"><span
aria-hidden="true">&times;</span></button> aria-hidden="true">&times;</span></button>
</div> </div>
<div class="text-left pull-left"> <div class="text-left pull-left">
<pre class="text-left">ft7.2: Traceback (most recent call last): <pre class="text-left">st7.2: AsyncIO has no ssl handshake timeout</pre>
File "/home/matthias/Entwicklung/calibre-web-test/test/test_email_ssl.py", line 109, in test_SSL_STARTTLS_setup_error
self.assertEqual(ret[-1]['result'], 'Failed')
AssertionError: 'Waiting' != 'Failed'
- Waiting
+ Failed</pre>
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>
</div> </div>
<!--css div popup end--> <!--css div popup end-->
</td> </td>
</tr> </tr>
<tr id='ft7.3' class='none bg-danger'> <tr id='pt7.3' class='hiddenRow bg-success'>
<td> <td>
<div class='testcase'>test_SSL_logging_email</div> <div class='testcase'>test_SSL_logging_email</div>
</td> </td>
<td colspan='6'> <td colspan='6'>
<div class="text-center"> <div class="text-center">
<a class="popup_link text-center" onfocus='blur()' onclick="showTestDetail('div_ft7.3')">FAIL</a> <a class="popup_link text-center" onfocus='blur()' onclick="showTestDetail('div_pt7.3')">PASS</a>
</div> </div>
<!--css div popup start--> <!--css div popup start-->
<div id='div_ft7.3' class="popup_window test_output" style="display:none;"> <div id='div_pt7.3' class="popup_window test_output" style="display:none;">
<div class='close_button pull-right'> <div class='close_button pull-right'>
<button type="button" class="close" aria-label="Close" onfocus='this.blur();' <button type="button" class="close" aria-label="Close" onfocus='this.blur();'
onclick="document.getElementById('div_ft7.3').style.display='none'"><span onclick="document.getElementById('div_pt7.3').style.display='none'"><span
aria-hidden="true">&times;</span></button> aria-hidden="true">&times;</span></button>
</div> </div>
<div class="text-left pull-left"> <div class="text-left pull-left">
<pre class="text-left">ft7.3: Traceback (most recent call last): <pre class="text-left">pt7.3: User: name@host.com, Password: 10234
File "/home/matthias/Entwicklung/calibre-web-test/test/test_email_ssl.py", line 137, in test_SSL_logging_email Receiving message from: ('127.0.0.1', 38658)
self.assertTrue(len(re.findall('Subject: Calibre-Web test e-mail',data)),"Email logging not working") Message addressed from: name@host.com
AssertionError: 0 is not true : Email logging not working</pre> Message addressed to: a5@b.com
Message length : 42</pre>
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>
</div> </div>
<!--css div popup end--> <!--css div popup end-->
</td> </td>
</tr> </tr>
<tr id='ft7.4' class='none bg-danger'> <tr id='pt7.4' class='hiddenRow bg-success'>
<td> <td>
<div class='testcase'>test_SSL_only</div> <div class='testcase'>test_SSL_only</div>
</td> </td>
<td colspan='6'> <td colspan='6'>
<div class="text-center"> <div class="text-center">
<a class="popup_link text-center" onfocus='blur()' onclick="showTestDetail('div_ft7.4')">FAIL</a> <a class="popup_link text-center" onfocus='blur()' onclick="showTestDetail('div_pt7.4')">PASS</a>
</div> </div>
<!--css div popup start--> <!--css div popup start-->
<div id='div_ft7.4' class="popup_window test_output" style="display:none;"> <div id='div_pt7.4' class="popup_window test_output" style="display:none;">
<div class='close_button pull-right'> <div class='close_button pull-right'>
<button type="button" class="close" aria-label="Close" onfocus='this.blur();' <button type="button" class="close" aria-label="Close" onfocus='this.blur();'
onclick="document.getElementById('div_ft7.4').style.display='none'"><span onclick="document.getElementById('div_pt7.4').style.display='none'"><span
aria-hidden="true">&times;</span></button> aria-hidden="true">&times;</span></button>
</div> </div>
<div class="text-left pull-left"> <div class="text-left pull-left">
<pre class="text-left">ft7.4: Traceback (most recent call last): <pre class="text-left">pt7.4: User: name@host.com, Password: 10234
File "/home/matthias/Entwicklung/calibre-web-test/test/test_email_ssl.py", line 88, in test_SSL_only Receiving message from: ('127.0.0.1', 38660)
self.assertEqual(ret[-1]['result'], 'Finished') Message addressed from: name@host.com
AssertionError: 'Waiting' != 'Finished' Message addressed to: a1@b.com
- Waiting Message length : 22013</pre>
+ Finished</pre>
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>
</div> </div>
@ -1989,12 +1976,12 @@ AssertionError: False is not true : logfile config value is not empty after rese
<!--css div popup end--> <!--css div popup end-->
</td> </td>
</tr> </tr>
<tr class='errorClass'> <tr class='skipClass'>
<td>test_register.test_register</td> <td>test_register.test_register</td>
<td class="text-center">5</td> <td class="text-center">5</td>
<td class="text-center">2</td> <td class="text-center">4</td>
<td class="text-center">0</td>
<td class="text-center">0</td> <td class="text-center">0</td>
<td class="text-center">2</td>
<td class="text-center">1</td> <td class="text-center">1</td>
<td class="text-center"> <td class="text-center">
<a onclick="showClassDetail('c12', 5)">Detail</a> <a onclick="showClassDetail('c12', 5)">Detail</a>
@ -2029,36 +2016,32 @@ AssertionError: False is not true : logfile config value is not empty after rese
</td> </td>
<td colspan='6' align='center'>PASS</td> <td colspan='6' align='center'>PASS</td>
</tr> </tr>
<tr id='et12.3' class='none bg-info'> <tr id='pt12.3' class='hiddenRow bg-success'>
<td> <td>
<div class='testcase'>test_registering_user</div> <div class='testcase'>test_registering_user</div>
</td> </td>
<td colspan='6'> <td colspan='6'>
<div class="text-center"> <div class="text-center">
<a class="popup_link text-center" onfocus='blur()' onclick="showTestDetail('div_et12.3')">ERROR</a> <a class="popup_link text-center" onfocus='blur()' onclick="showTestDetail('div_pt12.3')">PASS</a>
</div> </div>
<!--css div popup start--> <!--css div popup start-->
<div id='div_et12.3' class="popup_window test_output" style="display:none;"> <div id='div_pt12.3' class="popup_window test_output" style="display:none;">
<div class='close_button pull-right'> <div class='close_button pull-right'>
<button type="button" class="close" aria-label="Close" onfocus='this.blur();' <button type="button" class="close" aria-label="Close" onfocus='this.blur();'
onclick="document.getElementById('div_et12.3').style.display='none'"><span onclick="document.getElementById('div_pt12.3').style.display='none'"><span
aria-hidden="true">&times;</span></button> aria-hidden="true">&times;</span></button>
</div> </div>
<div class="text-left pull-left"> <div class="text-left pull-left">
<pre class="text-left">et12.3: User: name@host.com, Password: 10234 <pre class="text-left">pt12.3: User: name@host.com, Password: 10234
Receiving message from: ('127.0.0.1', 36440) Receiving message from: ('127.0.0.1', 45484)
Message addressed from: name@host.com Message addressed from: name@host.com
Message addressed to: huj@de.de Message addressed to: huj@de.de
Message length : 1Traceback (most recent call last): Message length : 276
File "/home/matthias/Entwicklung/calibre-web-test/test/test_register.py", line 80, in test_registering_user User: name@host.com, Password: 10234
user, passw = self.email_server.handler.extract_register_info() Receiving message from: ('127.0.0.1', 45498)
File "/home/matthias/Entwicklung/calibre-web-test/test/email_convert_helper.py", line 90, in extract_register_info Message addressed from: name@host.com
self.message = email.message_from_string(self.message).get_payload(0).get_payload(decode=True).decode('utf-8') Message addressed to: huij@de.de
File "/usr/lib/python3.6/email/__init__.py", line 38, in message_from_string Message length : 284</pre>
return Parser(*args, **kws).parsestr(s)
File "/usr/lib/python3.6/email/parser.py", line 68, in parsestr
return self.parse(StringIO(text), headersonly=headersonly)
TypeError: initial_value must be str or None, not list</pre>
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>
</div> </div>
@ -2082,118 +2065,75 @@ TypeError: initial_value must be str or None, not list</pre>
</div> </div>
<div class="text-left pull-left"> <div class="text-left pull-left">
<pre class="text-left">pt12.4: User: name@host.com, Password: 10234 <pre class="text-left">pt12.4: User: name@host.com, Password: 10234
Receiving message from: ('127.0.0.1', 36442) Receiving message from: ('127.0.0.1', 45500)
Message addressed from: name@host.com Message addressed from: name@host.com
Message addressed to: huj@de.com Message addressed to: huj@de.com
Message length : 1</pre> Message length : 286</pre>
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>
</div> </div>
<!--css div popup end--> <!--css div popup end-->
</td> </td>
</tr> </tr>
<tr id='et12.5' class='none bg-info'> <tr id='pt12.5' class='hiddenRow bg-success'>
<td> <td>
<div class='testcase'>test_user_change_password</div> <div class='testcase'>test_user_change_password</div>
</td> </td>
<td colspan='6'> <td colspan='6'>
<div class="text-center"> <div class="text-center">
<a class="popup_link text-center" onfocus='blur()' onclick="showTestDetail('div_et12.5')">ERROR</a> <a class="popup_link text-center" onfocus='blur()' onclick="showTestDetail('div_pt12.5')">PASS</a>
</div> </div>
<!--css div popup start--> <!--css div popup start-->
<div id='div_et12.5' class="popup_window test_output" style="display:none;"> <div id='div_pt12.5' class="popup_window test_output" style="display:none;">
<div class='close_button pull-right'> <div class='close_button pull-right'>
<button type="button" class="close" aria-label="Close" onfocus='this.blur();' <button type="button" class="close" aria-label="Close" onfocus='this.blur();'
onclick="document.getElementById('div_et12.5').style.display='none'"><span onclick="document.getElementById('div_pt12.5').style.display='none'"><span
aria-hidden="true">&times;</span></button> aria-hidden="true">&times;</span></button>
</div> </div>
<div class="text-left pull-left"> <div class="text-left pull-left">
<pre class="text-left">et12.5: User: name@host.com, Password: 10234 <pre class="text-left">pt12.5: User: name@host.com, Password: 10234
Receiving message from: ('127.0.0.1', 36444) Receiving message from: ('127.0.0.1', 45502)
Message addressed from: name@host.com
Message addressed to: passwd@de.com
Message length : 286
User: name@host.com, Password: 10234
Receiving message from: ('127.0.0.1', 45504)
Message addressed from: name@host.com Message addressed from: name@host.com
Message addressed to: passwd@de.com Message addressed to: passwd@de.com
Message length : 1Traceback (most recent call last): Message length : 212
File "/home/matthias/Entwicklung/calibre-web-test/test/test_register.py", line 118, in test_user_change_password User: name@host.com, Password: 10234
user, passw = self.email_server.handler.extract_register_info() Receiving message from: ('127.0.0.1', 45506)
File "/home/matthias/Entwicklung/calibre-web-test/test/email_convert_helper.py", line 90, in extract_register_info Message addressed from: name@host.com
self.message = email.message_from_string(self.message).get_payload(0).get_payload(decode=True).decode('utf-8') Message addressed to: passwd@de.com
File "/usr/lib/python3.6/email/__init__.py", line 38, in message_from_string Message length : 212</pre>
return Parser(*args, **kws).parsestr(s)
File "/usr/lib/python3.6/email/parser.py", line 68, in parsestr
return self.parse(StringIO(text), headersonly=headersonly)
TypeError: initial_value must be str or None, not list</pre>
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>
</div> </div>
<!--css div popup end--> <!--css div popup end-->
</td> </td>
</tr> </tr>
<tr class='errorClass'> <tr class='failClass'>
<td>test_shelf.test_shelf</td> <td>test_shelf.test_shelf</td>
<td class="text-center">7</td> <td class="text-center">7</td>
<td class="text-center">5</td>
<td class="text-center">2</td> <td class="text-center">2</td>
<td class="text-center">1</td> <td class="text-center">0</td>
<td class="text-center">4</td>
<td class="text-center">0</td> <td class="text-center">0</td>
<td class="text-center"> <td class="text-center">
<a onclick="showClassDetail('c13', 7)">Detail</a> <a onclick="showClassDetail('c13', 7)">Detail</a>
</td> </td>
</tr> </tr>
<tr id='et13.1' class='none bg-info'> <tr id='pt13.1' class='hiddenRow bg-success'>
<td> <td>
<div class='testcase'>test_delete_book_of_shelf</div> <div class='testcase'>test_delete_book_of_shelf</div>
</td> </td>
<td colspan='6'> <td colspan='6' align='center'>PASS</td>
<div class="text-center">
<a class="popup_link text-center" onfocus='blur()' onclick="showTestDetail('div_et13.1')">ERROR</a>
</div>
<!--css div popup start-->
<div id='div_et13.1' class="popup_window test_output" style="display:none;">
<div class='close_button pull-right'>
<button type="button" class="close" aria-label="Close" onfocus='this.blur();'
onclick="document.getElementById('div_et13.1').style.display='none'"><span
aria-hidden="true">&times;</span></button>
</div>
<div class="text-left pull-left">
<pre class="text-left">et13.1: Traceback (most recent call last):
File "/home/matthias/Entwicklung/calibre-web-test/test/test_shelf.py", line 205, in test_delete_book_of_shelf
self.get_book_details(books[1][7]['id'])
File "/home/matthias/Entwicklung/calibre-web-test/test/ui_helper.py", line 669, in get_book_details
if id&gt;0:
TypeError: '&gt;' not supported between instances of 'str' and 'int'</pre>
</div>
<div class="clearfix"></div>
</div>
<!--css div popup end-->
</td>
</tr> </tr>
<tr id='et13.2' class='none bg-info'> <tr id='pt13.2' class='hiddenRow bg-success'>
<td> <td>
<div class='testcase'>test_private_shelf</div> <div class='testcase'>test_private_shelf</div>
</td> </td>
<td colspan='6'> <td colspan='6' align='center'>PASS</td>
<div class="text-center">
<a class="popup_link text-center" onfocus='blur()' onclick="showTestDetail('div_et13.2')">ERROR</a>
</div>
<!--css div popup start-->
<div id='div_et13.2' class="popup_window test_output" style="display:none;">
<div class='close_button pull-right'>
<button type="button" class="close" aria-label="Close" onfocus='this.blur();'
onclick="document.getElementById('div_et13.2').style.display='none'"><span
aria-hidden="true">&times;</span></button>
</div>
<div class="text-left pull-left">
<pre class="text-left">et13.2: Traceback (most recent call last):
File "/home/matthias/Entwicklung/calibre-web-test/test/test_shelf.py", line 70, in test_private_shelf
details = self.get_book_details(books[1][0]['id'])
File "/home/matthias/Entwicklung/calibre-web-test/test/ui_helper.py", line 669, in get_book_details
if id&gt;0:
TypeError: '&gt;' not supported between instances of 'str' and 'int'</pre>
</div>
<div class="clearfix"></div>
</div>
<!--css div popup end-->
</td>
</tr> </tr>
<tr id='pt13.3' class='hiddenRow bg-success'> <tr id='pt13.3' class='hiddenRow bg-success'>
<td> <td>
@ -2201,61 +2141,37 @@ TypeError: '&gt;' not supported between instances of 'str' and 'int'</pre>
</td> </td>
<td colspan='6' align='center'>PASS</td> <td colspan='6' align='center'>PASS</td>
</tr> </tr>
<tr id='et13.4' class='none bg-info'> <tr id='ft13.4' class='none bg-danger'>
<td> <td>
<div class='testcase'>test_public_shelf</div> <div class='testcase'>test_public_shelf</div>
</td> </td>
<td colspan='6'> <td colspan='6'>
<div class="text-center"> <div class="text-center">
<a class="popup_link text-center" onfocus='blur()' onclick="showTestDetail('div_et13.4')">ERROR</a> <a class="popup_link text-center" onfocus='blur()' onclick="showTestDetail('div_ft13.4')">FAIL</a>
</div> </div>
<!--css div popup start--> <!--css div popup start-->
<div id='div_et13.4' class="popup_window test_output" style="display:none;"> <div id='div_ft13.4' class="popup_window test_output" style="display:none;">
<div class='close_button pull-right'> <div class='close_button pull-right'>
<button type="button" class="close" aria-label="Close" onfocus='this.blur();' <button type="button" class="close" aria-label="Close" onfocus='this.blur();'
onclick="document.getElementById('div_et13.4').style.display='none'"><span onclick="document.getElementById('div_ft13.4').style.display='none'"><span
aria-hidden="true">&times;</span></button> aria-hidden="true">&times;</span></button>
</div> </div>
<div class="text-left pull-left"> <div class="text-left pull-left">
<pre class="text-left">et13.4: Traceback (most recent call last): <pre class="text-left">ft13.4: Traceback (most recent call last):
File "/home/matthias/Entwicklung/calibre-web-test/test/test_shelf.py", line 109, in test_public_shelf File "/home/matthias/Entwicklung/calibre-web-test/test/test_shelf.py", line 121, in test_public_shelf
details = self.get_book_details(books[1][0]['id']) self.assertTrue(len(shelf_books[0]) == 2)
File "/home/matthias/Entwicklung/calibre-web-test/test/ui_helper.py", line 669, in get_book_details AssertionError: False is not true</pre>
if id&gt;0:
TypeError: '&gt;' not supported between instances of 'str' and 'int'</pre>
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>
</div> </div>
<!--css div popup end--> <!--css div popup end-->
</td> </td>
</tr> </tr>
<tr id='et13.5' class='none bg-info'> <tr id='pt13.5' class='hiddenRow bg-success'>
<td> <td>
<div class='testcase'>test_rename_shelf</div> <div class='testcase'>test_rename_shelf</div>
</td> </td>
<td colspan='6'> <td colspan='6' align='center'>PASS</td>
<div class="text-center">
<a class="popup_link text-center" onfocus='blur()' onclick="showTestDetail('div_et13.5')">ERROR</a>
</div>
<!--css div popup start-->
<div id='div_et13.5' class="popup_window test_output" style="display:none;">
<div class='close_button pull-right'>
<button type="button" class="close" aria-label="Close" onfocus='this.blur();'
onclick="document.getElementById('div_et13.5').style.display='none'"><span
aria-hidden="true">&times;</span></button>
</div>
<div class="text-left pull-left">
<pre class="text-left">et13.5: Traceback (most recent call last):
File "/home/matthias/Entwicklung/calibre-web-test/test/test_shelf.py", line 148, in test_rename_shelf
self.get_book_details(books[1][0]['id'])
File "/home/matthias/Entwicklung/calibre-web-test/test/ui_helper.py", line 669, in get_book_details
if id&gt;0:
TypeError: '&gt;' not supported between instances of 'str' and 'int'</pre>
</div>
<div class="clearfix"></div>
</div>
<!--css div popup end-->
</td>
</tr> </tr>
<tr id='ft13.6' class='none bg-danger'> <tr id='ft13.6' class='none bg-danger'>
<td> <td>
@ -2852,16 +2768,16 @@ AssertionError: 'Not Implemented' is not None : Database change</pre>
<tr id='total_row' class="text-center bg-grey"> <tr id='total_row' class="text-center bg-grey">
<td>Total</td> <td>Total</td>
<td>162</td> <td>162</td>
<td>95</td> <td>103</td>
<td>7</td> <td>3</td>
<td>6</td> <td>0</td>
<td>54</td> <td>56</td>
<td>&nbsp;</td> <td>&nbsp;</td>
</tr> </tr>
</table> </table>
<script> <script>
drawCircle(95, 7, 6, 54); drawCircle(103, 3, 0, 56);
</script> </script>
</div> </div>

Loading…
Cancel
Save