{"action":"created","issue":{"url":"https://api.github.com/repos/librenms/librenms/issues/5261","repository_url":"https://api.github.com/repos/librenms/librenms","labels_url":"https://api.github.com/repos/librenms/librenms/issues/5261/labels{/name}","comments_url":"https://api.github.com/repos/librenms/librenms/issues/5261/comments","events_url":"https://api.github.com/repos/librenms/librenms/issues/5261/events","html_url":"https://github.com/librenms/librenms/issues/5261","id":198009137,"number":5261,"title":"[API] Problem with force_add and addHost function + fix","user":{"login":"PandaWawawa","id":5919830,"avatar_url":"https://avatars.githubusercontent.com/u/5919830?v=3","gravatar_id":"","url":"https://api.github.com/users/PandaWawawa","html_url":"https://github.com/PandaWawawa","followers_url":"https://api.github.com/users/PandaWawawa/followers","following_url":"https://api.github.com/users/PandaWawawa/following{/other_user}","gists_url":"https://api.github.com/users/PandaWawawa/gists{/gist_id}","starred_url":"https://api.github.com/users/PandaWawawa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PandaWawawa/subscriptions","organizations_url":"https://api.github.com/users/PandaWawawa/orgs","repos_url":"https://api.github.com/users/PandaWawawa/repos","events_url":"https://api.github.com/users/PandaWawawa/events{/privacy}","received_events_url":"https://api.github.com/users/PandaWawawa/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-12-29T13:42:23Z","updated_at":"2016-12-29T15:01:49Z","closed_at":null,"body":"Hi everyone,\r\n\r\nI just faced a problem using the force_add parameters in the add_device function in api_functions.inc.php\r\n\r\nThis functions uses the addHost function in includes/functions.php where it checks the $force_add parameter to be '=== true'\r\nOr the add_device function get the force_add post parameter and apply a 'mres()' on it, which transforms it into '1' (which is not '=== true') \r\n\r\nI changed on my side the add_device function\r\n`$force_add    = $data['force_add'] ? mres($data['force_add']) : 0;`\r\nto\r\n`$force_add    = $data['force_add'] ? true : false;`\r\nto get this working\r\n\r\nMaybe we can push this change ?\r\n\r\n++\r\n"},"comment":{"url":"https://api.github.com/repos/librenms/librenms/issues/comments/269642135","html_url":"https://github.com/librenms/librenms/issues/5261#issuecomment-269642135","issue_url":"https://api.github.com/repos/librenms/librenms/issues/5261","id":269642135,"user":{"login":"laf","id":3941142,"avatar_url":"https://avatars.githubusercontent.com/u/3941142?v=3","gravatar_id":"","url":"https://api.github.com/users/laf","html_url":"https://github.com/laf","followers_url":"https://api.github.com/users/laf/followers","following_url":"https://api.github.com/users/laf/following{/other_user}","gists_url":"https://api.github.com/users/laf/gists{/gist_id}","starred_url":"https://api.github.com/users/laf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/laf/subscriptions","organizations_url":"https://api.github.com/users/laf/orgs","repos_url":"https://api.github.com/users/laf/repos","events_url":"https://api.github.com/users/laf/events{/privacy}","received_events_url":"https://api.github.com/users/laf/received_events","type":"User","site_admin":false},"created_at":"2016-12-29T15:01:49Z","updated_at":"2016-12-29T15:01:49Z","body":"Yeah submit a fix :)"}}
{"actor":{"display_login":"laf"}}