[pisa-src] r2947 - in trunk/pairing/webif: mobileaccess-add.sh mobileaccess-cand.sh mobileaccess.sh

  • From: Christoph Viethen <christoph.viethen@xxxxxxxxxxxxxx>
  • To: pisa-src@xxxxxxxxxxxxx
  • Date: Thu, 22 Mar 2012 16:47:26 +0100

Author: viethen
Date: Thu Mar 22 16:47:25 2012
New Revision: 2947

Log:
Make Pairing scripts aware of an "end date".

Modified:
   trunk/pairing/webif/mobileaccess-add.sh
   trunk/pairing/webif/mobileaccess-cand.sh
   trunk/pairing/webif/mobileaccess.sh

Modified: trunk/pairing/webif/mobileaccess-add.sh
==============================================================================
--- trunk/pairing/webif/mobileaccess-add.sh     Thu Mar 22 15:29:39 2012        
(r2946)
+++ trunk/pairing/webif/mobileaccess-add.sh     Thu Mar 22 16:47:25 2012        
(r2947)
@@ -127,9 +127,16 @@
             confirmation_form=''
             final_text=''
         else
-            uci_add mobileaccess paired_device
-            uci_set mobileaccess "${CONFIG_SECTION}" identifier 
"${POST_identifier}"
-            uci_set mobileaccess "${CONFIG_SECTION}" hit "${hit}"
+            # Calculate the enddate - we want pairings to last half a year by 
default
+            #  (the user can change this easily later)
+            pairing_enddate=$(pisa-pairing-date $(date -I) 6)
+
+            if [ "(" $? -eq 0 ")" -a "(" ${#pairing_enddate} -eq 10 ")" ]; then
+                uci_add mobileaccess paired_device
+                uci_set mobileaccess "${CONFIG_SECTION}" identifier 
"${POST_identifier}"
+                uci_set mobileaccess "${CONFIG_SECTION}" hit "${hit}"
+                uci_set mobileaccess "${CONFIG_SECTION}" enddate 
"${pairing_enddate}"
+            fi
 
             pagecontent='<h2>Done ...</h2>Don'"'"'t forget to "Apply" the 
change if you want it to become active.'
 

Modified: trunk/pairing/webif/mobileaccess-cand.sh
==============================================================================
--- trunk/pairing/webif/mobileaccess-cand.sh    Thu Mar 22 15:29:39 2012        
(r2946)
+++ trunk/pairing/webif/mobileaccess-cand.sh    Thu Mar 22 16:47:25 2012        
(r2947)
@@ -32,7 +32,7 @@
 echo "The following list shows devices this Trust Point currently is 
associated with."
 echo '<P style="padding-top:1ex">Click on "Pair ..." to add a device to the 
list of paired devices.</P>'
 
-/root/pairing/pairing-candidates
+pisa-pairing-candidates
 
 footer ?>
 

Modified: trunk/pairing/webif/mobileaccess.sh
==============================================================================
--- trunk/pairing/webif/mobileaccess.sh Thu Mar 22 15:29:39 2012        (r2946)
+++ trunk/pairing/webif/mobileaccess.sh Thu Mar 22 16:47:25 2012        (r2947)
@@ -70,13 +70,27 @@
         eval device_hit=$device_hit_ref
         unset device_hit_ref
 
+        device_enddate_ref=\${CONFIG_${cfg_name}_enddate}
+        eval device_enddate=$device_enddate_ref
+        unset device_enddate_ref
+
         paired_devices_tmp=${paired_devices_tmp}"start_form|"${device_id}"
-field|HIT
+# field|HIT:
+string|<tr>
+string|<td width=\"40%\">HIT:</td><td width=\"60%\" style=\"text-align:right\">
 string|"${device_hit}"
 submit|revoke_pairing_"${cfg_name}"|Revoke Pairing|
+# field|Paired until:
+string|<tr>
+string|<td width=\"40%\">Paired until:</td><td width=\"60%\" 
style=\"text-align:right\">
+string|"${device_enddate}"
 
 end_form
 "
+
+# there could be another line above: submit|change_date_"${cfg_name}"|Change 
date ...|
+# (temporarily removed)
+
         device_i=$((device_i+1))
     done
 else
-- 
This is the pisa developer mailing list. Please also subscribe to the main pisa 
list at:
//www.freelists.org/list/pisa

Other related posts:

  • » [pisa-src] r2947 - in trunk/pairing/webif: mobileaccess-add.sh mobileaccess-cand.sh mobileaccess.sh - Christoph Viethen