| | |
| | | //* verify the key |
| | | if($package['package_installable'] == 'key' && $install_key != '') { |
| | | |
| | | $repo = $app->db->queryOneRecord("SELECT * FROM software_repo WHERE software_repo_id = ".$package['software_repo_id']); |
| | | $repo = $app->db->queryOneRecord("SELECT * FROM software_repo WHERE software_repo_id = ".$app->db->quote($package['software_repo_id'])); |
| | | |
| | | $client = new SoapClient(null, array('location' => $repo['repo_url'], |
| | | 'uri' => $repo['repo_url'])); |
| | |
| | | $message_err = 'Verification of the key failed.'; |
| | | } else { |
| | | // Store the verified key into the database |
| | | $app->db->datalogUpdate('software_package', "package_key = '$install_key'", 'package_id', $package['package_id']); |
| | | $app->db->datalogUpdate('software_package', "package_key = '".$app->db->quote($install_key)."'", 'package_id', $package['package_id']); |
| | | } |
| | | } else { |
| | | $message_ok = 'Please enter the software key for the package.'; |
| | |
| | | |
| | | //* Install packages, if all requirements are fullfilled. |
| | | if($install_server_id > 0 && $package_name != '' && ($package['package_installable'] == 'yes' || $install_key_verified == true)) { |
| | | $sql = "SELECT software_update_id, package_name, update_title FROM software_update WHERE type = 'full' AND package_name = '$package_name' ORDER BY v1 DESC, v2 DESC, v3 DESC, v4 DESC LIMIT 0,1"; |
| | | $sql = "SELECT software_update_id, package_name, update_title FROM software_update WHERE type = 'full' AND package_name = '".$app->db->quote($package_name)."' ORDER BY v1 DESC, v2 DESC, v3 DESC, v4 DESC LIMIT 0,1"; |
| | | $tmp = $app->db->queryOneRecord($sql); |
| | | $software_update_id = $tmp['software_update_id']; |
| | | |
| | |
| | | $app->db->datalogUpdate('software_package', "package_config = '".$app->db->quote($package_config_str)."'", 'package_id', $package['package_id']); |
| | | |
| | | $sql = "INSERT INTO `remote_user` (`sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `remote_username`, `remote_password`, `remote_functions`) VALUES |
| | | (1, 1, 'riud', 'riud', '', '$remote_user', '$remote_password_md5', '$remote_functions');"; |
| | | (1, 1, 'riud', 'riud', '', '".$app->db->quote($remote_user)."', '".$app->db->quote($remote_password_md5)."', '".$app->db->quote($remote_functions)."');"; |
| | | |
| | | $app->db->query($sql); |
| | | |
| | |
| | | } |
| | | |
| | | //* Add the record to start the install process |
| | | $insert_data = "(package_name, server_id, software_update_id, status) VALUES ('$package_name', '$install_server_id', '$software_update_id','installing')"; |
| | | $insert_data = "(package_name, server_id, software_update_id, status) VALUES ('".$app->db->quote($package_name)."', '".$app->db->quote($install_server_id)."', '".$app->db->quote($software_update_id)."','installing')"; |
| | | $app->db->datalogInsert('software_update_inst', $insert_data, 'software_update_inst_id'); |
| | | $message_ok = 'Starting package installation '."<a href=\"#\" onclick=\"submitForm('pageForm','admin/software_package_list.php');\">".$app->lng('next')."</a>"; |
| | | |