Commit e1d011a3 authored by Gabriel Monnerat's avatar Gabriel Monnerat

implemented code to check if an user was created correctly

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@43952 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9ca50ce6
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>import json\n
\n
portal = context.getPortalObject()\n
person = portal.portal_catalog.getResultValue(portal_type="Person",\n
validation_state="validated",\n
**kw)\n
return json.dumps(dict(response=(person is not None)))\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>**kw</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_getUserValidationState</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -104,22 +104,51 @@ function changeCheckBoxValue(value){\n
});\n
}\n
\n
function waitCreateUNGUser(paramStr){\n
$.get("ERP5Site_getUserValidationState?" + paramStr, {}, function(data, textStatus, XMLHttpRequest){\n
data = jQuery.parseJSON(data);\n
if (data.response == true){\n
clearTimeout();\n
setTimeout(window.location.reload(), 2000);\n
}\n
else {\n
setTimeout(waitCreateUNGUser(paramStr), 2000);\n
}\n
});\n
}\n
\n
function displayLoginForm(){\n
$("a.ung_docs, img[alt=\'calendar_logo_box\'], table#create-new-user").hide();\n
$("a.ung_docs, img[alt=\'calendar_logo_box\'], table#create-new-user, img[alt=\'mail_logo_box\']").hide();\n
$("div.header-left div.field input, div.main-right, div.main-left").hide();\n
$.get("WebSection_loginDialog", function(data){\n
$("div.header-left fieldset.widget").append("<p>" + data + "</p>");\n
$("td#new-account-form").click(function(event){\n
$("table#field_table, table#new-account-table").hide();\n
$("table#create-new-user input[type=\'text\'], table#create-new-user input[type=\'password\']").each(function(){\n
$(this).attr("value", "");\n
});\n
$("table#create-new-user").show();\n
$("form#create-user").submit(function(event){\n
event.preventDefault();\n
var formHash = {};\n
var paramList = $("form#create-user").serializeArray();\n
for (var i=0; i < paramList.length; i++){\n
formHash[paramList[i].name] = paramList[i].value;\n
}\n
if (formHash.password != formHash.confirm){\n
$("td#form-message").text("Please confirm your password correctly..");\n
$("td#form-message").fadeIn(300).delay(800).fadeOut(1000);\n
return false;\n
}\n
$.ajax({\n
type: \'post\',\n
url: \'ERPSite_createUNGUser\',\n
data: $("form#create-user").serializeArray(),\n
dataType: "json",\n
});\n
var paramStr = "first_name=" + formHash.firstname +\n
"&" + "last_name=" + formHash.lastname;\n
setTimeout(waitCreateUNGUser(paramStr), 2000);\n
});\n
});\n
});\n
......@@ -469,6 +498,10 @@ $().ready(function(){\n
$("div.header-right").css("width", "52.3%");\n
};\n
$("a.tree-open").parent().parent().css("background-color", "#BBCCFF");\n
if (window.location.href.match("^http.*\\/unfoldDomain") != null){\n
$("a.document").css("text-decoration", "none")\n
.css("color", "#000");\n
}\n
return false;\n
});
......
268
\ No newline at end of file
269
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment