//param, val //Permissions //id, permission, value //smb_users // pass is base64 encoded plaintext //id, login, password, contactName, email, companyName, phone, fax, address, city, state, zip, country, creationDate, isBuiltIn, roleId, uuid, isLocked, authCookie, sessionId, externalId, ownerId, isDomainAdmin, additionalInfo, imNumber, imType, isLegacyUser /* TODO: sys_users // mapped_to = parent_id id, login, account_id, home, shell, quota, mapped_to */ add_command('unset MYSERVER'); add_command('unset MYSQL_EXPORT_USER'); add_command('unset MYSQL_EXPORT_PASS'); add_command('unset MYSQL_IMPORT_USER'); add_command('unset MYSQL_IMPORT_PASS'); add_command('# END'); file_put_contents('/tmp/plesk_import_commands.sh', $COMMANDS); } else { $msg .= 'Connecting to external database failed!<br />'; $msg .= $exdb->connect_error; $msg .= substr($exdb->errorMessage, 0, 25); $error .= $exdb->errorMessage; } //* restore db login details /*$conf['db_host'] = $conf_bak['db_host']; $conf['db_database'] = $conf_bak['db_database']; $conf['db_user'] = $conf_bak['db_user']; $conf['db_password'] = $conf_bak['db_password'];*/ } $app->tpl->setVar('msg', $msg); $app->tpl->setVar('error', $error);
$slim->render('profiles/passcode.php'); })->name("new_passcode_profile"); $slim->post('/profiles/:profile_id', function ($profile_id) use($slim) { if ($_POST["type"] == "passcode") { $values = passcode_profile_array($_POST); // TODO: update my profile } })->name("update_profile")->conditions(array('profile_id' => '\\d+')); $slim->post('/profiles/new', function () use($slim) { // TODO: save this - do we have to save each profile type individually? if ($_POST["type"] == "passcode") { $values = passcode_profile_array($_POST); // TODO: create a new profile } })->name("create_profile"); /** Device pages */ $slim->get('/device/all', function () use($slim) { $devices = all_devices(); $slim->render('devices/all.php', array("devices" => $devices)); })->name("devices"); $slim->get('/device/:udid', function ($udid) use($slim) { })->name("device_detail"); $slim->get('/device/:udid/lock', function ($udid) use($slim) { $device = find_device($udid); $command = create_device_lock(); add_command($device, $command); send_push($device); })->name("device_lock"); $slim->run();