phpipam
phpipam copied to clipboard
RADIUS authentication fails on 1.6.0
Describe the bug Have been using phpIPAM with radius authentication successfully for years. Running "phpipam-docker". After upgrade from 1.5.0 to 1.60 (latest) radius fails error (see add. info)
Radius request reaches authentication server.
phpIPAM version Bug fixes are supported in the latest production and development releases. Please update to a supported release before reporting issues. Please search for existing Issues (including closed Issues) before submitting duplicates.
Versions of phpIPAM known to contain the issue (delete as appropriate).
- Latest git
master
development branch.
Your Environment (please supply the following information):
- Latest
- Ubuntu 22.0.4.x
- Docker
Steps To Reproduce Please include steps to reproduce the issue:
- Login with radius
Screenshots and error logs
Please set $debugging=true;
in your config.php and include any reported error messages. If applicable, add screenshots or other error logs to help explain your problem.
Additional Info
10.40.0.4 - - [18/Dec/2023:13:37:21 +0100] "GET /login/ HTTP/1.1" 200 1724 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
[Mon Dec 18 13:37:23.595496 2023] [php:error] [pid 25] [client 10.40.0.4:42668] PHP Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /phpipam/functions/classes/class.Radius.php:579\nStack trace:\n#0 /phpipam/functions/classes/class.Radius.php(397): Radius->SetAttribute()\n#1 /phpipam/functions/classes/class.Radius.php(697): Radius->SetUsername()\n#2 /phpipam/functions/classes/class.User.php(1185): Radius->AccessRequest()\n#3 /phpipam/functions/classes/class.User.php(837): User->auth_radius()\n#4 /phpipam/app/login/login_check.php(51): User->authenticate()\n#5 {main}\n thrown in /phpipam/functions/classes/class.Radius.php on line 579, referer: https://ipam.ipam.xxxxx.xxxxx.no/login/
10.40.0.4 - - [18/Dec/2023:13:37:23 +0100] "POST /app/login/login_check.php HTTP/1.1" 500 20 "https://ipam.ipam.xxxxx.xxxxx.no/login/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
can you check this ? https://github.com/phpipam/phpipam/pull/3985/files
It was just merged to master branch.
I am having the same issue. I have turned on debugging and this is the error I receive:
Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /var/www/phpipam/functions/classes/class.Radius.php:579 Stack trace: #0 /var/www/phpipam/functions/classes/class.Radius.php(397): Radius->SetAttribute() #1 /var/www/phpipam/functions/classes/class.Radius.php(298): Radius->SetUsername() #2 /var/www/phpipam/functions/classes/class.User.php(1180): Radius->__construct() #3 /var/www/phpipam/functions/classes/class.User.php(837): User->auth_radius() #4 /var/www/phpipam/app/login/login_check.php(51): User->authenticate() #5 {main} thrown in /var/www/phpipam/functions/classes/class.Radius.php on line 579
I did make the change on line 231 in the class.Radius.php file that was suggested.
Can you test this diff ?
diff --git a/functions/classes/class.Radius.php b/functions/classes/class.Radius.php
index 71e17ed..2168022 100644
--- a/functions/classes/class.Radius.php
+++ b/functions/classes/class.Radius.php
@@ -576,7 +576,7 @@ class Radius
function SetAttribute($type, $value)
{
$attribute_index = -1;
- $attribute_count = count($this->_attributes_to_send);
+ $attribute_count = !is_null($this->_attributes_to_send) ? count($this->_attributes_to_send) : 0;
for ($attributes_loop = 0; $attributes_loop < $attribute_count; $attributes_loop++)
{
if ($type == ord(substr($this->_attributes_to_send[$attributes_loop], 0, 1)))
@@ -716,7 +716,8 @@ class Radius
}
$attributes_content = '';
- $attribute_count1 = count($this->_attributes_to_send);
+ $attribute_count1 = !is_null($this->_attributes_to_send) ? count($this->_attributes_to_send) : 0;
+
for ($attributes_loop = 0; $attributes_loop < $attribute_count1; $attributes_loop++)
{
$attributes_content .= $this->_attributes_to_send[$attributes_loop];
Those changes worked. I am able to login using Radius. I still have debugging turned on and I recieved this message between the login and 2FA request:
Deprecated: Implicit conversion from float 5.960464477539063-8 to int loses precision in /var/www/phpipam/functions/classes/class.Radius.php on line 607 Deprecated: Implicit conversion from float 1.52587890625-5 to int loses precision in /var/www/phpipam/functions/classes/class.Radius.php on line 607 Deprecated: Implicit conversion from float 0.00390625 to int loses precision in /var/www/phpipam/functions/classes/class.Radius.php on line 607
It only pops up for a second or two (right before the page refreshes to ask for the 2FA code.
I left just commented out the old lines for the diff changes you suggested so it shifted what line 607 would be. The line is:
$temp_attribute = chr($type).chr(6).chr(($value / (256 * 256 * 256)) % 256).chr(($value / (256 * 256)) % 256).chr(($value / (256)) % 256).chr($value % 256);
Here it is in context:
case 'A': // Address, 32 bit value, most significant octet first.
$ip_array = pf_explode(".", $value);
$temp_attribute = chr($type).chr(6).chr($ip_array[0]).chr($ip_array[1]).chr($ip_array[2]).chr($ip_array[3]);
break;
case 'I': // Integer, 32 bit unsigned value, most significant octet first.
$temp_attribute = chr($type).chr(6).chr(($value / (256 * 256 * 256)) % 256).chr(($value / (256 * 256)) % 256).chr(($value / (256)) % 256).chr($value % 256);
break;
case 'D': // Time, 32 bit unsigned value, most significant octet first -- seconds since 00:00:00 UTC, January 1, 1970. (not used in this RFC)
$temp_attribute = NULL;
break;
It is the command in "Case 'I'"
Now that I can login with my Radius account, I am getting this error when I try to edit an Address:
jQuery error! Internal Server Error Status: error Error: Internal Server Error
The save appears to be successful but I am getting the error.
Turning on debugging I get the following Error:
Fatal error: Uncaught Error: Undefined constant "PHPMailer\PHPMailer\FILTER_FLAG_HOST_REQUIRED" in /var/www/phpipam/functions/PHPMailer/src/PHPMailer.php:3631 Stack trace: #0 /var/www/phpipam/functions/PHPMailer/src/PHPMailer.php(3597): PHPMailer\PHPMailer\PHPMailer::isValidHost() #1 /var/www/phpipam/functions/PHPMailer/src/PHPMailer.php(2336): PHPMailer\PHPMailer\PHPMailer->serverHostname() #2 /var/www/phpipam/functions/PHPMailer/src/PHPMailer.php(1453): PHPMailer\PHPMailer\PHPMailer->createHeader() #3 /var/www/phpipam/functions/PHPMailer/src/PHPMailer.php(1348): PHPMailer\PHPMailer\PHPMailer->preSend() #4 /var/www/phpipam/functions/classes/class.Log.php(1921): PHPMailer\PHPMailer\PHPMailer->send() #5 /var/www/phpipam/functions/classes/class.Log.php(849): Logging->changelog_send_mail() #6 /var/www/phpipam/functions/classes/class.Log.php(788): Logging->changelog_write_to_db() #7 /var/www/phpipam/functions/classes/class.Addresses.php(492): Logging->write_changelog() #8 /var/www/phpipam/functions/classes/class.Addresses.php(365): Addresses->modify_address_edit() #9 /var/www/phpipam/app/subnets/addresses/address-modify-submit.php(363): Addresses->modify_address() #10 {main} thrown in /var/www/phpipam/functions/PHPMailer/src/PHPMailer.php on line 3631
This error does not happen when logged in as the local admin user.
PHPMailer\PHPMailer\FILTER_FLAG_HOST_REQUIRED
Update your submodules. git submodule update --init --recursive
and this should go away.
When I run that command I get a long list of errors:
error: The following untracked working tree files would be overwritten by checkout: .gitattributes AHGBold.ttf LICENSE.txt README.FONT.txt README.md WavFile.php audio/.htaccess audio/en/0.wav audio/en/1.wav audio/en/10.wav audio/en/11.wav audio/en/12.wav audio/en/13.wav audio/en/14.wav audio/en/15.wav audio/en/16.wav audio/en/17.wav audio/en/18.wav audio/en/19.wav audio/en/2.wav audio/en/20.wav audio/en/3.wav audio/en/4.wav audio/en/5.wav audio/en/6.wav audio/en/7.wav audio/en/8.wav audio/en/9.wav audio/en/A.wav audio/en/B.wav audio/en/C.wav audio/en/D.wav audio/en/E.wav audio/en/F.wav audio/en/G.wav audio/en/H.wav audio/en/I.wav audio/en/J.wav audio/en/K.wav audio/en/L.wav audio/en/M.wav audio/en/MINUS.wav audio/en/N.wav audio/en/O.wav audio/en/P.wav audio/en/PLUS.wav audio/en/Q.wav audio/en/R.wav audio/en/S.wav audio/en/T.wav audio/en/TIMES.wav audio/en/U.wav audio/en/V.wav audio/en/W.wav audio/en/X.wav audio/en/Y.wav audio/en/Z.wav audio/en/error.wav audio/noise/check-point-1.wav audio/noise/crowd-talking-1.wav audio/noise/crowd-talking-6.wav audio/noise/crowd-talking-7.wav audio/noise/kids-playing-1.wav backgrounds/bg3.jpg backgrounds/bg4.jpg backgrounds/bg5.jpg backgrounds/bg6.png captcha.html composer.json config.inc.php.SAMPLE database/.htaccess database/index.html database/securimage.sq3 example_form.ajax.php example_form.php examples/display_value.php examples/multiple_captchas_single_page.php examples/multiple_words.php examples/securimage_show_example.php examples/securimage_show_example2.php examples/static_captcha.php examples/test.mysql.php examples/test.mysql.static.php examples/test.pgsql.php examples/test.sqlite.php images/audio_icon.png images/loading.png images/refresh.png securimage.css securimage.js securimage.php securimage_play.php securimage_play.swf securimage_show.php words/words.txt Please move or remove them before you switch branches. error: The following untracked working tree files would be removed by checkout: README.txt Please move or remove them before you switch branches. Aborting error: The following untracked working tree files would be overwritten by checkout: .gitignore .travis.yml LICENSE.md PHPGangsta/GoogleAuthenticator.php README.md composer.json tests/GoogleAuthenticatorTest.php tests/bootstrap.php tests/phpunit.xml Please move or remove them before you switch branches. Aborting error: The following untracked working tree files would be overwritten by checkout: .gitattributes .gitignore .phan/config.php LICENSE README.md SECURITY.md UPGRADING.md VERSION changelog.md composer.json docs/README.md examples/DKIM_gen_keys.phps examples/DKIM_sign.phps examples/README.md examples/callback.phps examples/contactform.phps examples/contents.html examples/contentsutf8.html examples/exceptions.phps examples/extending.phps examples/gmail.phps examples/gmail_xoauth.phps examples/images/phpmailer.png examples/images/phpmailer_mini.png examples/mail.phps examples/mailing_list.phps examples/pop_before_smtp.phps examples/send_file_upload.phps examples/send_multiple_file_upload.phps examples/sendmail.phps examples/simple_contact_form.phps examples/smime_signed_mail.phps examples/smtp.phps examples/smtp_check.phps examples/smtp_low_memory.phps examples/smtp_no_auth.phps examples/ssl_options.phps get_oauth_token.php language/phpmailer.lang-ar.php language/phpmailer.lang-az.php language/phpmailer.lang-ba.php language/phpmailer.lang-be.php language/phpmailer.lang-bg.php language/phpmailer.lang-ca.php language/phpmailer.lang-cs.php language/phpmailer.lang-da.php language/phpmailer.lang-de.php language/phpmailer.lang-el.php language/phpmailer.lang-eo.php language/phpmailer.lang-es.php language/phpmailer.lang-et.php language/phpmailer.lang-fa.php language/phpmailer.lang-fi.php language/phpmailer.lang-fo.php language/phpmailer.lang-fr.php language/phpmailer.lang-gl.php language/phpmailer.lang-he.php language/phpmailer.lang-hi.php language/phpmailer.lang-hr.php language/phpmailer.lang-hu.php language/phpmailer.lang-id.php language/phpmailer.lang-it.php language/phpmailer.lang-ja.php language/phpmailer.lang-ka.php language/phpmailer.lang-ko.php language/phpmailer.lang-lt.php language/phpmailer.lang-lv.php language/phpmailer.lang-ms.php language/phpmailer.lang-nb.php language/phpmailer.lang-nl.php language/phpmailer.lang-pl.php language/phpmailer.lang-pt.php language/phpmailer.lang-pt_br.php language/phpmailer.lang-ro.php language/phpmailer.lang-ru.php language/phpmailer.lang-sk.php language/phpmailer.lang-sl.php language/phpmailer.lang-sv.php language/phpmailer.lang-tl.php language/phpmailer.lang-tr.php language/phpmailer.lang-uk.php language/phpmailer.lang-vi.php language/phpmailer.lang-zh.php language/phpmailer.lang-zh_cn.php phpdoc.dist.xml src/Exception.php src/OAuth.php src/PHPMailer.php src/POP3.php src/SMTP.php test/DebugLogTestListener.php test/fakepopserver.sh test/fakesendmail.sh test/runfakepopserver.sh test/testbootstrap-dist.php Please move or remove them before you switch branches. error: The following untracked working tree files would be removed by checkout: .github/ISSUE_TEMPLATE.md .github/PULL_REQUEST_TEMPLATE.md .php_cs .scrutinizer.yml .travis.yml language/phpmailer.lang-am.php language/phpmailer.lang-ch.php language/phpmailer.lang-rs.php test/PHPMailerLangTest.php test/PHPMailerTest.php test/bootstrap.php travis.phpunit.xml.dist Please move or remove them before you switch branches. Aborting error: The following untracked working tree files would be overwritten by checkout: .gitattributes .travis.yml LICENSE.txt Parsedown.php README.md composer.json phpunit.xml.dist test/CommonMarkTestStrict.php test/CommonMarkTestWeak.php test/ParsedownTest.php test/SampleExtensions.php test/TestParsedown.php test/data/aesthetic_table.html test/data/aesthetic_table.md test/data/aligned_table.html test/data/aligned_table.md test/data/atx_heading.html test/data/atx_heading.md test/data/automatic_link.html test/data/automatic_link.md test/data/block-level_html.html test/data/block-level_html.md test/data/code_block.html test/data/code_block.md test/data/code_span.html test/data/code_span.md test/data/compound_blockquote.html test/data/compound_blockquote.md test/data/compound_emphasis.html test/data/compound_emphasis.md test/data/compound_list.html test/data/compound_list.md test/data/deeply_nested_list.html test/data/deeply_nested_list.md test/data/em_strong.html test/data/em_strong.md test/data/email.html test/data/email.md test/data/emphasis.html test/data/emphasis.md test/data/escaping.html test/data/escaping.md test/data/fenced_code_block.html test/data/fenced_code_block.md test/data/horizontal_rule.html test/data/horizontal_rule.md test/data/html_comment.html test/data/html_comment.md test/data/html_entity.html test/data/html_entity.md test/data/image_reference.html test/data/image_reference.md test/data/image_title.html test/data/image_title.md test/data/implicit_reference.html test/data/implicit_reference.md test/data/inline_link.html test/data/inline_link.md test/data/inline_link_title.html test/data/inline_link_title.md test/data/inline_title.html test/data/inline_title.md test/data/lazy_blockquote.html test/data/lazy_blockquote.md test/data/lazy_list.html test/data/lazy_list.md test/data/line_break.html test/data/line_break.md test/data/multiline_list_paragraph.html test/data/multiline_list_paragraph.md test/data/multiline_lists.html test/data/multiline_lists.md test/data/nested_block-level_html.html test/data/nested_block-level_html.md test/data/ordered_list.html test/data/ordered_list.md test/data/paragraph_list.html test/data/paragraph_list.md test/data/reference_title.html test/data/reference_title.md test/data/self-closing_html.html test/data/self-closing_html.md test/data/separated_nested_list.html test/data/separated_nested_list.md test/data/setext_header.html test/data/setext_header.md test/data/simple_blockquote.html test/data/simple_blockquote.md test/data/simple_table.html test/data/simple_table.md test/data/span-level_html.html test/data/span-level_html.md test/data/sparse_dense_list.html test/data/sparse_dense_list.md test/data/sparse_html.html test/data/sparse_html.md test/data/sparse_list.html test/data/sparse_list.md test/data/special_characters.html test/data/special_characters.md test/data/strikethrough.html test/data/strikethrough.md test/data/strong_em.html test/data/strong_em.md test/data/tab-indented_code_block.html test/data/tab-indented_code_block.md test/data/table_inline_markdown.html test/data/table_inline_markdown.md test/data/text_reference.html test/data/text_reference.md test/data/unordered_list.html test/data/unordered_list.md test/data/untidy_table.html test/data/untidy_table.md test/data/url_autolinking.html test/data/url_autolinking.md test/data/whitespace.html test/data/whitespace.md test/data/xss_attribute_encoding.html test/data/xss_attribute_encoding.md test/data/xss_bad_url.html test/data/xss_bad_url.md test/data/xss_text_encoding.html test/data/xss_text_encoding.md Please move or remove them before you switch branches. Aborting error: The following untracked working tree files would be overwritten by checkout: .coveralls.yml .gitattributes .gitignore .travis.yml CHANGELOG LICENSE README.md _toolkit_loader.php advanced_settings_example.php certs/README composer.json demo1/Readme.txt demo1/attrs.php demo1/index.php demo1/metadata.php demo1/settings_example.php demo2/Readme.txt demo2/consume.php demo2/index.php demo2/metadata.php demo2/slo.php demo2/sso.php endpoints/acs.php endpoints/metadata.php endpoints/sls.php phpdoc.xml phpunit.xml settings_example.php src/Saml2/Auth.php src/Saml2/AuthnRequest.php src/Saml2/Constants.php src/Saml2/Error.php src/Saml2/IdPMetadataParser.php src/Saml2/LogoutRequest.php src/Saml2/LogoutResponse.php src/Saml2/Metadata.php src/Saml2/Response.php src/Saml2/Settings.php src/Saml2/Utils.php src/Saml2/ValidationError.php src/Saml2/schemas/saml-schema-assertion-2.0.xsd src/Saml2/schemas/saml-schema-authn-context-2.0.xsd src/Saml2/schemas/saml-schema-authn-context-types-2.0.xsd src/Saml2/schemas/saml-schema-metadata-2.0.xsd src/Saml2/schemas/saml-schema-protocol-2.0.xsd src/Saml2/schemas/sstc-metadata-attr.xsd src/Saml2/schemas/sstc-saml-attribute-ext.xsd src/Saml2/schemas/sstc-saml-metadata-algsupport-v1.0.xsd src/Saml2/schemas/sstc-saml-metadata-ui-v1.0.xsd src/Saml2/schemas/xenc-schema.xsd src/Saml2/schemas/xml.xsd src/Saml2/schemas/xmldsig-core-schema.xsd src/Saml2/version.json tests/ZendModStandard/Docs/Debug/CodeAnalyzerStandard.xml tests/ZendModStandard/Docs/Files/ClosingTagStandard.xml tests/ZendModStandard/Docs/NamingConventions/ValidVariableNameStandard.xml tests/ZendModStandard/Sniffs/Debug/CodeAnalyzerSniff.php tests/ZendModStandard/Sniffs/Files/ClosingTagSniff.php tests/ZendModStandard/Sniffs/NamingConventions/ValidVariableNameSniff.php tests/ZendModStandard/ruleset.xml tests/bootstrap.php tests/certs/certificate1 tests/compatibility.php tests/data/customPath/advanced_settings.php tests/data/customPath/certs/metadata.crt tests/data/customPath/certs/metadata.key tests/data/customPath/certs/sp.crt tests/data/customPath/certs/sp.key tests/data/customPath/settings.php tests/data/logout_requests/invalids/invalid_issuer.xml tests/data/logout_requests/invalids/invalid_issuer.xml.base64 tests/data/logout_requests/invalids/invalid_xml.xml.base64 tests/data/logout_requests/invalids/no_nameId.xml tests/data/logout_requests/invalids/not_after_failed.xml tests/data/logout_requests/invalids/not_after_failed.xml.base64 tests/data/logout_requests/logout_request.xml tests/data/logout_requests/logout_request.xml.base64 tests/data/logout_requests/logout_request_deflated.xml.base64 tests/data/logout_requests/logout_request_encrypted_nameid.xml tests/data/logout_requests/logout_request_with_sessionindex.xml tests/data/logout_responses/invalids/invalid_xml.xml.base64 tests/data/logout_responses/invalids/no_status.xml.base64 tests/data/logout_responses/invalids/status_code_responder.xml.base64 tests/data/logout_responses/logout_response.xml tests/data/logout_responses/logout_response.xml.base64 tests/data/logout_responses/logout_response_deflated.xml.base64 tests/data/metadata/expired_metadata_settings1.xml tests/data/metadata/idp/FederationMetadata.xml tests/data/metadata/idp/idp_metadata.xml tests/data/metadata/idp/idp_metadata2.xml tests/data/metadata/idp/idp_metadata_different_sign_and_encrypt_cert.xml tests/data/metadata/idp/idp_metadata_multi_certs.xml tests/data/metadata/idp/idp_metadata_multi_signing_certs.xml tests/data/metadata/idp/idp_metadata_same_sign_and_encrypt_cert.xml tests/data/metadata/idp/idp_multiple_descriptors.xml tests/data/metadata/idp/metadata.xml tests/data/metadata/idp/onelogin_metadata.xml tests/data/metadata/idp/shib_metadata.xml tests/data/metadata/idp/testshib-providers.xml tests/data/metadata/metadata_bad_order_settings1.xml tests/data/metadata/metadata_settings1.xml tests/data/metadata/noentity_metadata_settings1.xml tests/data/metadata/signed_metadata_settings1.xml tests/data/metadata/unparse Aborting error: The following untracked working tree files would be overwritten by checkout: .gitattributes .gitignore CHANGELOG.txt LICENSE README.md composer.json src/Utils/XPath.php src/XMLSecEnc.php src/XMLSecurityDSig.php src/XMLSecurityKey.php tests/aes128-gcm-res.xml tests/aes192-gcm-res.xml tests/aes256-gcm-res.xml tests/basic-doc-encrypted-aes128-cbc.xml tests/basic-doc-encrypted-aes192-cbc.xml tests/basic-doc-encrypted-aes256-cbc.xml tests/basic-doc-encrypted-tripledes-cbc.xml tests/basic-doc.xml tests/encrypteddata-node-order.phpt tests/generatesessionkey-basics.phpt tests/generatesessionkey-parity.phpt tests/getcipherdata.phpt tests/getsymmetrickeysize.phpt tests/mycert.pem tests/oaep_sha1-content-res.xml tests/oaep_sha1-res.xml tests/privkey.pem tests/retrievalmethod-findkey.phpt tests/retrievalmethod-findkey.xml tests/saml/encryption.key tests/saml/encryption_rsa.key tests/saml/saml-decrypt.phpt tests/saml/saml-encrypted.xml tests/sign-basic-test.res tests/sign-basic-test.xml tests/sign-c14-comments.phpt tests/sign-c14-comments.res tests/sign-empty-uri.phpt tests/sign-empty-uri.res tests/sign-formatted-test.xml tests/sign-hhvm-id-wout-ns-regenerated.phpt tests/sign-hhvm-id-wout-ns-regenerated.xml tests/sign-sha256-rsa-sha256-test.res tests/sign-subject.res tests/thumbprint.phpt tests/validate_digest_sha512.phpt tests/withcomment-empty-uri.phpt tests/withcomment-empty-uri.xml tests/withcomment-id-uri-object.phpt tests/withcomment-id-uri-object.xml tests/withcomment-id-uri.phpt tests/withcomment-id-uri.xml tests/xml-sign-prefix-ds.res tests/xml-sign-prefix-none.res tests/xml-sign-prefix-pfx.res tests/xml-sign-prefix.phpt tests/xml-sign-sha256-rsa-sha256.phpt tests/xml-sign-subject.phpt tests/xml-sign.phpt tests/xmlsec-decrypt-content.phpt tests/xmlsec-decrypt.phpt tests/xmlsec-encrypt-aes-gmc.phpt tests/xmlsec-encrypt-content.phpt tests/xmlsec-encrypt-noreplace.phpt tests/xmlsec-encrypt.phpt tests/xmlsec-verify-formatted.phpt tests/xmlsec-verify-rsa-sha256.phpt tests/xmlsec-verify.phpt xmlseclibs.php Please move or remove them before you switch branches. error: The following untracked working tree files would be removed by checkout: .travis.yml Please move or remove them before you switch branches. Aborting fatal: Unable to checkout '2be13fddff68a72dee2c68196dbce7c8f825bcc1' in submodule path 'app/login/captcha' fatal: Unable to checkout '505c2af8337b559b33557f37cda38e5f843f3768' in submodule path 'functions/GoogleAuthenticator' fatal: Unable to checkout 'cbe9d8d9a9adb7dff77852a3cfc9b63ede3e7a89' in submodule path 'functions/PHPMailer' fatal: Unable to checkout '77947eda2fdaf06b181c63a7db13e38968306aee' in submodule path 'functions/parsedown' fatal: Unable to checkout '5fbf3486704ac9835b68184023ab54862c95f213' in submodule path 'functions/php-saml' fatal: Unable to checkout 'cf50b5023964550d714df76ba9adf21eb6fdaa35' in submodule path 'functions/xmlseclibs'
I suggest you reinstall phpipam completely :) Here are the steps, assuming your installation folder is /var/www/phpipam:
cd /var/www/
mv phpipam phpipam.bkp
GIT clone --recursive https://github.com/phpipam/phpipam.git phpipam
cd phpipam
git checkout -b 1.6 origin/1.6
cp /var/www/phpipam.bkp/config.php .
Radius class was taken from http://developer.sysco.ch/php/ , I think someone contributed to phpipam long ago. Will try to update all code to php8, but need to setup a local Radius server to be able to test.
Or we can change to https://github.com/dapphp/radius as proposed in #1900, would make more sense.
@phpipam https://github.com/phpipam/phpipam/pull/3988
Did you saw my last comment? this commit seens to work on phpipam 1.6 php8, but not on phpipam 1.5 php7
I'm updating and testing all functions of class.Radius.php to work with php7 and php8
What error do you get in webserver/php-fpm logs ?
But the same code worked with php8. I think specify the variable as a array is a better way to solve the issue, on my tests it worked with php7 and php8. https://github.com/phpipam/phpipam/pull/3988 I'm changing the code to all functions that use array be specified.
Can you test now, I pushed new code to master that uses dapphp/radius ?
git checkout master
git pull
cd functions
composer install
root@debian:/var/www/html/functions# composer install
-bash: composer: command not found
I installed the composer, but after that I get the follow error
root@debian:/var/www/html/functions# composer install
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Continue as root/super user [yes]? yes
No lock file found. Updating dependencies instead of installing from lock file. Use composer update over composer install if you do not have a lock file.
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires firehed/webauthn dev-main -> satisfiable by firehed/webauthn[dev-main].
- firehed/webauthn dev-main requires php ^8.1 -> your php version (7.4.33) does not satisfy that requirement.
Ok, for test remove webauthn and cbor from composer.json and run composer install again.
Now composer installed dapphp/radius, but get the error.
root@debian:/var/www/html/functions# composer install
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Continue as root/super user [yes]? Y
No lock file found. Updating dependencies instead of installing from lock file. Use composer update over composer install if you do not have a lock file.
Loading composer repositories with package information
Updating dependencies
Lock file operations: 1 install, 0 updates, 0 removals
- Locking dapphp/radius (v3.0.0)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
- Downloading dapphp/radius (v3.0.0)
- Installing dapphp/radius (v3.0.0): Extracting archive
Generating autoload files
But now we have a new error:
The change https://github.com/phpipam/phpipam/pull/3988 worked for phpipam 1.5 with php7 and phpipam 1.6 with php8, I'm working on the class.Radius.php to make it 100% compatible, with php7 and php8, but just setting the variable to array worked to the function Access-Accept ( that is the one that phpipam used for authentication ).
@phpipam With the function class.Radius.php we can get Attributes to use in the future for permissioning.
root@debian:/var/www/html/functions/classes# php TEST.php
1
Array
(
[0] => Array
(
[0] => 26
[1] => :▒full
)
[1] => Array
(
[0] => 26
[1] => ▒
)
[2] => Array
(
[0] => 26
[1] => "▒
)
[3] => Array
(
[0] => 26
[1] => shell:priv-lvl=15
)
[4] => Array
(
[0] => 26
[1] => shell:roles="sysadmin"
)
[5] => Array
(
[0] => 18
[1] => phpipam:group="Administrators"
)
)
root@debian:/var/www/html/functions/classes# php
php php8.2 php.default phpdismod phpenmod phpquery
root@debian:/var/www/html/functions/classes# php8.2 TEST.php
1
Array
(
[0] => Array
(
[0] => 26
[1] => :▒full
)
[1] => Array
(
[0] => 26
[1] => ▒
)
[2] => Array
(
[0] => 26
[1] => "▒
)
[3] => Array
(
[0] => 26
[1] => shell:priv-lvl=15
)
[4] => Array
(
[0] => 26
[1] => shell:roles="sysadmin"
)
[5] => Array
(
[0] => 18
[1] => phpipam:group="Administrators"
)
)
root@debian:/var/www/html/functions/classes# php8.2 TEST.php
1
Array
(
[0] => Array
(
[0] => 26
[1] => :▒full
)
[1] => Array
(
[0] => 26
[1] => ▒
)
[2] => Array
(
[0] => 26
[1] => "▒
)
[3] => Array
(
[0] => 26
[1] => shell:priv-lvl=15
)
[4] => Array
(
[0] => 26
[1] => shell:roles="sysadmin"
)
[5] => Array
(
[0] => 18
[1] => phpipam:group="Administrators"
)
)
Solved the last Deprecated problem that I found on this class.Radius.php https://www.drupal.org/project/color_field/issues/3265958
@phpipam
Hi I send a new pull with all fix and updates on class.Radius.php https://github.com/phpipam/phpipam/pull/3989
Probably with that, the project could folllow with same class.Radius.php, and on the future we can use the Radius attributes to define user groups. ( something that I'm working on my fork ).
I merged changes into master for now, but it makes more sense to continue with dapphp/radius - supports better encryption and is maintained.
I merged changes into master for now, but it makes more sense to continue with dapphp/radius - supports better encryption and is maintained.
It's a good point that is maintaned, but which encryption it supports that the old code doesn't? I will be nice to me to implement it on this old code.
PR to 1.6.0 https://github.com/phpipam/phpipam/pull/3991