Odyssey
MbrExtKey.data
1 <?php
2 
3 /*
4  * File: MbrExtKey.data
5  * Purpose: Handle the CRUD portion of the MbrExtKey maintenance script
6  * When returning the requested data do it in a JSON format, for the client to
7  * display accordingly.
8  *
9  * Call this script with the following parameters
10  * cu to identify appropriate {$Cu}extkey table (might use $Cu out of cookie?)
11  * action - what the client side is requesting.
12  * trustid for data related to a particular providermode in {$Cu}extkey table
13  * ***trustid must match existing cutrusteddetail record for given $Cu
14  * member - to identify member for whom edits occur
15  *
16  * Returns JSON OBJECT.
17  *
18  * based on trustid / providermode, load appropriate include to define
19  * parms_parse - explode parms into component values
20  * parms_validate - check entries before attemtping db update
21  * includes readying for db write
22  * parms_disp4edit - layout screen for display / edit values
23  */
24 $retStatus_ary = Array(
25  'homecuInfo' => '',
26  'homecuErrors' => Array(),
27  'homecuData' => ''
28 );
29 
30 
31 try {
32  $str_pos = strpos($_SERVER['SERVER_NAME'], ".");
33  $home_host = substr($_SERVER['SERVER_NAME'], 0, $str_pos);
34 
35  $POSTED = Array();
36 
37  $dms_ok = array('action' => 'string', 'trustid' => 'string', 'cu' => 'string', 'member' => 'string',
38  'accountnumber' => 'string', 'keyid' => 'string', "userid" => "string");
39 
40  dms_import_v2($POSTED, "HCUPOST", $dms_ok);
41 
42  //Open database connection
43  $trustid = $POSTED['HCUPOST']['trustid'];
44  $accountnumber = $POSTED['HCUPOST']['accountnumber'];
45  switch ($trustid) {
46  case "HcuEZCARD":
47  require_once ("$admLibrary/MbrExHcuEZCARD.i");
48  $dms_ok = array('card4' => 'digits', 'cardsig' => 'string', 'cardtype' => 'string');
49  dms_import_v2($POSTED, "HCUPOST", $dms_ok);
50  require_once 'MbrExEZCARD.data';
51  break;
52  case "HcuMIR":
53  require_once ("$admLibrary/MbrExHcuMIR.i");
54  require_once 'MbrExMIR.data';
55  break;
56  case "HcuDMI":
57  require_once ("$admLibrary/MbrExHcuDMI.i");
58  $dms_ok = array('dmiloan' => 'digits', 'accounttype' => 'string');
59  dms_import_v2($POSTED, "HCUPOST", $dms_ok);
60  $accounttype = $POSTED['HCUPOST']['accounttype'];
61  require_once 'MbrExDMI.data';
62  break;
63  default:
64  throw new Exception("Invalid Provider");
65  break;
66  }
67  if (isset($exerror)) {
68  throw new Exception($exerror);
69  }
70 } catch (Exception $ex) {
71  $retStatus_ary['homecuErrors'][] = $ex->getMessage();
72 }
73 
74 ?>