Page 1 of 1

Access form from a url with autoconnect

PostPosted: Thu Aug 13, 2015 6:46 pm
by ltrannoy
Hi,

I modified the code and nucommon.js index.php to allow direct access to a form and registration.
It certainly deserves to be optimized or corrected.

I use the parameter "f".

index.php
Line 33: $k = isset($_GET['k']) ? $_GET['k'] : ''; $f = isset($_GET['f']) ? $_GET['f'] : ''; // LTR : direct access to a form
Line 59: window.nuPrimaryKey = '$k'; window.form_id = '$f'; // LTR : direct access to a form
Line 118: toggleModalMode(window.nuPrimaryKey, window.form_id); //toggleModalMode(); // LTR : direct access to a form
Line 120: nuLogin(window.nuUsername, window.nuPassword, window.nuPrimaryKey, window.form_id); // nuLogin(window.nuUsername, window.nuPassword, window.nuPrimaryKey);

nucommon.js
Line 138: function toggleModalMode(k,f){ //function toggleModalMode(){ //-- login screen // LTR : direct access to a form
Line 268: nuLogin(undefined,undefined,k,f); // nuLogin(); // LTR : direct access to a form
Line 276: e.setAttribute('onclick', 'nuLogin(undefined,undefined,"'+k+'","'+f+'")'); // e.setAttribute('onclick', 'nuLogin()'); // LTR : direct access to a form
Line 1543: function nuLogin(u, p, k, f){ //function nuLogin(u, p, k){ // LTR : direct access to a form
Line 1553: if(typeof u == "undefined" || typeof p == "undefined"){ //if(arguments.length == 0){ // LTR : direct access to a form
Line 1576: toggleModalMode(k,f); //toggleModalMode(); // LTR : direct access to a form
Line 1580: window.nuFORM.form_id = f == '' ? data.DATA['index_id'] : f; //window.nuFORM.form_id = data.DATA['index_id']; // LTR : direct access to a form
Line 1589: //w.record_id = '-1'; // LTR : direct access to a form

Many greetings

Re: Access form from a url with autoconnect

PostPosted: Thu May 18, 2017 7:34 am
by israelwebdev
Thanks!
I was able to do some cool stuff with this, such as showing the permalink in the Location bar...
Code: Select all

<script>

function nuLoadEditGlobal(){

   nuOnLoad();
   if (window.top === window.self) {
       if(window.location.search.indexOf('?i=')>=0)
      window.history.replaceState('',document.title,'?f='+nuFORM.form_id+'&k='+nuFORM.record_id);
       else
      window.history.pushState('',document.title,'?f='+nuFORM.form_id+'&k='+nuFORM.record_id);
   }
}



Re: Access form from a url with autoconnect

PostPosted: Thu Jun 01, 2017 5:05 am
by admin
.