From 5534209eff20e63e64f5147ae69748952b9e7c87 Mon Sep 17 00:00:00 2001 From: rylon Date: Thu, 6 Mar 2014 19:24:47 +0100 Subject: [PATCH] uVote register "fix" -> not yet completed default page needs 2 use default_register()! --- uVote/page/default_page/js/loadtexts.js | 36 ++++++++++++++----------- uVote/page/page_uvote.php | 2 +- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/uVote/page/default_page/js/loadtexts.js b/uVote/page/default_page/js/loadtexts.js index 753dba7..ed5747c 100644 --- a/uVote/page/default_page/js/loadtexts.js +++ b/uVote/page/default_page/js/loadtexts.js @@ -53,22 +53,7 @@ $(document).ready(function() { }); $('#user_main').load('./?action=user_main', function(){ - - $("#register_user_form input").not("[type=submit]").jqBootstrapValidation( - { - preventSubmit: true, - submitError: function($form, event, errors) {}, - submitSuccess: function($form, event){ - $.get('./api.php?call=account&action=create&username=' + $('#register_username').val() + '&password_sha=' + $.sha1($('#user_register_password1').val()) + '&email=' + $('#register_email').val() + '&locale=deDE', function (data) { - if(data == 1){ - window.location.reload(); - } else { - $('#help-block-user-password-combi-wrong').attr('style', 'display: block;'); - } - }); - event.preventDefault(); - } - }); + register_registerform(); $('#feedback_submit').click(function (data){ var test = $('textarea#feedback_text').val(); send_feedback(test); @@ -85,6 +70,24 @@ $(document).ready(function() { }); +function register_registerform(){ + $("#register_user_form input").not("[type=submit]").jqBootstrapValidation( + { + preventSubmit: true, + submitError: function($form, event, errors) {}, + submitSuccess: function($form, event){ + $.get('./api.php?call=account&action=create&username=' + $('#register_username').val() + '&password_sha=' + $.sha1($('#user_register_password1').val()) + '&email=' + $('#register_email').val() + '&locale=deDE', function (data) { + if(data == 1){ + window.location.reload(); + } else { + $('#help-block-user-password-combi-wrong').attr('style', 'display: block;'); + } + }); + event.preventDefault(); + } + }); +} + function drawChart(){ //load_visualisation('#graph_bt_uv_overall',84600); } @@ -147,6 +150,7 @@ function vote_click (poll_ID, vote) { alert("success"); $('#user_main').load('./?action=open_bulletin&poll_ID=' + poll_ID, function(){ open_vote(poll_ID); + register_registerform(); }); } else { alert(data.result.message); diff --git a/uVote/page/page_uvote.php b/uVote/page/page_uvote.php index e96214d..daef087 100644 --- a/uVote/page/page_uvote.php +++ b/uVote/page/page_uvote.php @@ -7,7 +7,7 @@ class page_uvote extends \SYSTEM\API\api_default { public static function action_open_bulletin ($poll_ID){ if(!\SYSTEM\SECURITY\Security::isLoggedIn()){ - return new default_register ($poll_ID);} + return new default_register ();} return new default_bulletin($poll_ID);} public static function action_user_main(){