<% if _SESSION["logined"] ~= nil then local name = _POST["name"] local ssh_key_path = _POST["ssh_key_path"] local ssh_password = _POST["ssh_password"] local modify = _POST["modify"] if modify == nil then local result = c_GetSSHKey(name) if result ~= nil then print("0") else local retval = c_AddSSHKey(name,ssh_key_path,ssh_password) if retval == false then print("-1") c_AddAdminLog("administrator '".._SESSION["admin"].."' added ssh key config ["..name.."] failed.",ADMIN_LOG_ERROR) else print("1") c_AddAdminLog("administrator '".._SESSION["admin"].."' added ssh key config ["..name.."]",ADMIN_LOG_OK) end end else local retval = c_AddSSHKey(name,ssh_key_path,ssh_password) if retval == false then print("-1") c_AddAdminLog("administrator '".._SESSION["admin"].."' modified ssh key config ["..name.."] failed.",ADMIN_LOG_ERROR) else print("1") c_AddAdminLog("administrator '".._SESSION["admin"].."' modified ssh key config ["..name.."]",ADMIN_LOG_OK) end end end %>