Access form from a url with autoconnect

Access form from a url with autoconnect

Postby ltrannoy » Thu Aug 13, 2015 6:46 pm

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
Attachments
Screen Shot 08-13-15 at 11.09 AM.JPG
Screen Shot 08-13-15 at 11.09 AM.JPG (230.32 KiB) Viewed 4262 times
ltrannoy
 
Posts: 19
Joined: Sat Jul 26, 2014 5:39 pm
Location: France

Re: Access form from a url with autoconnect

Postby israelwebdev » Thu May 18, 2017 7:34 am

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);
   }
}


israelwebdev
 
Posts: 21
Joined: Fri May 23, 2014 1:38 am

Re: Access form from a url with autoconnect

Postby admin » Thu Jun 01, 2017 5:05 am

.
admin
Site Admin
 
Posts: 3132
Joined: Mon Jun 15, 2009 9:53 am


Return to Custom Code