unraid / unraid/webgui

Core Join/Leave buttons' enabled state is driven by the same broken join-status detection as #2748

Open
#2,749 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
253
Forks
106
Avg merge
6d 22h
Merged PRs (30d)
12

Description

Core Join/Leave buttons' enabled state is driven by the same broken join-status detection as #2748

Where: Same file as bug #2748 , SMBActiveDirectory.page.

The bug: the Join/Leave buttons' disabled state is computed as:

$adJoined = $var['joinStatus'] == "Joined";
...
<input type="submit" name="cmdJoinDomain" value="_(Join)_" <?=$adJoined ? "disabled" : "";?>>
<input type="submit" name="cmdLeaveDomain" value="_(Leave)_" <?=$adJoined ? "" : "disabled";?>>

Since $var['joinStatus'] is the same underlying detection that
inaccurately reports "Not joined" on boxes that are genuinely, actively
joined (the original motivating inaccuracy behind our own
net ads testjoin-based status check), $adJoined is effectively
always false in practice.

Impact, two distinct consequences:

  • Join is always clickable, even on an already-joined box, inviting
    users to trigger an unnecessary rejoin (and, per bug #2748 , an
    unnecessary array stop) on a connection that was already fine.
  • Leave is always disabled. There is no way to leave the domain
    through Unraid's stock UI at all, for as long as the underlying
    detection remains broken — not a cosmetic issue, a genuine missing
    capability.

How we found it: noted while reviewing the same file for bug #2748 ;
directly connects to the original status-display inaccuracy that
motivated this fork's own accurate join-status feature in the first
place.

Suggested fix: fix the underlying joinStatus detection (the same
fix needed for the display inaccuracy) — both consequences share one
root cause.

Our workaround: since our own plugin already computes an accurate
join status via net ads testjoin's exit code (not joinStatus's
apparent detection method, whatever that is), our own replacement UI
correctly enables/disables Join vs. Leave based on real state, for the
already-in-ads-mode case our replacement covers.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in SMBActiveDirectory.page and trace how joinStatus is detected, alongside the related fix described in bug #2748. Compare that state with the net ads testjoin exit code mentioned in the issue. Done means Join is disabled for an already-joined box, Leave is enabled there, and the inverse applies when it is not joined.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.