Example #1
0
             $ndc = new networkdb();
             $host = $ndc->getone(frm_get('nid', 1));
             if ($host) {
                 edit_network($host);
             }
         }
     }
     break;
 case 'storenetwork':
     if ($valuser->isadmin()) {
         $ndc = new networkdb();
         $nid = frm_get('nid', 1);
         if ($nid > 0) {
             $host = $ndc->getone($nid);
         } else {
             $host = new networkinstance();
         }
         if ($host) {
             $host->seturl(frm_get('url'));
             $host->setusername(frm_get('username'));
             $host->setpassword(frm_get('password'));
         }
         if ($host->valid()) {
             if ($nid > 0) {
                 $host->update();
                 $msg = get_lang(358);
             } else {
                 $host->store();
                 $msg = get_lang(357);
             }
         } else {
Example #2
0
         $host = $ndc->getone($_GET['nid']);
         if ($host) {
             edit_network($host);
         }
     }
     break;
 case 'storenetwork':
     if ($valuser->isadmin()) {
         $ndc = new networkdb();
         if (is_numeric($_POST['nid'])) {
             $nid = $_POST['nid'];
         }
         if ($nid > 0) {
             $host = $ndc->getone($nid);
         } else {
             $host = new networkinstance();
         }
         if ($host) {
             $host->seturl($_POST['url']);
             $host->setusername($_POST['username']);
             $host->setpassword($_POST['password']);
         }
         if ($host->valid()) {
             if ($nid > 0) {
                 $host->update();
                 $msg = get_lang(358);
             } else {
                 $host->store();
                 $msg = get_lang(357);
             }
         } else {