mirror of
https://github.com/Yetangitu/ampache
synced 2025-10-06 03:49:56 +02:00
made localplay technically work, lots of work to still do
This commit is contained in:
parent
649c44446a
commit
1dfdf2afab
9 changed files with 113 additions and 85 deletions
|
@ -128,29 +128,32 @@ class mpd {
|
|||
$this->errStr = "Could not connect";
|
||||
return;
|
||||
}
|
||||
else { list ( $this->mpd_version ) = sscanf($resp, MPD_RESPONSE_OK . " MPD %s\n");
|
||||
|
||||
if ( ! is_null($pwd) ) {
|
||||
if ( is_null($this->SendCommand(MPD_CMD_PASSWORD,$pwd)) ) {
|
||||
$this->connected = FALSE;
|
||||
$this->errStr = "Password supplied is incorrect or Invalid Command";
|
||||
return; // bad password or command
|
||||
}
|
||||
|
||||
list ( $this->mpd_version ) = sscanf($resp, OK . " MPD %s\n");
|
||||
|
||||
if ( ! empty($pwd) ) {
|
||||
if ( is_null($this->SendCommand(MPD_CMD_PASSWORD,$pwd)) ) {
|
||||
$this->connected = FALSE;
|
||||
$this->errStr = "Password supplied is incorrect or Invalid Command";
|
||||
return; // bad password or command
|
||||
}
|
||||
|
||||
if ( is_null($this->RefreshInfo()) ) { // no read access -- might as well be disconnected!
|
||||
$this->connected = FALSE;
|
||||
$this->errStr = "Password supplied does not have read access";
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if ( is_null($this->RefreshInfo()) ) { // no read access -- might as well be disconnected!
|
||||
$this->connected = FALSE;
|
||||
$this->errStr = "Password required to access server";
|
||||
return;
|
||||
}
|
||||
}
|
||||
if ( is_null($this->RefreshInfo()) ) { // no read access -- might as well be disconnected!
|
||||
$this->connected = FALSE;
|
||||
$this->errStr = "Password supplied does not have read access";
|
||||
return;
|
||||
}
|
||||
} // if password
|
||||
else {
|
||||
if ( is_null($this->RefreshInfo()) ) { // no read access -- might as well be disconnected!
|
||||
$this->connected = FALSE;
|
||||
$this->errStr = "Password required to access server";
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
} // constructor
|
||||
|
||||
/* Connect()
|
||||
*
|
||||
|
@ -185,7 +188,7 @@ class mpd {
|
|||
if (function_exists('socket_get_status')) {
|
||||
$status = socket_get_status($this->mpd_sock);
|
||||
}
|
||||
if (strncmp(MPD_RESPONSE_OK,$response,strlen(MPD_RESPONSE_OK)) == 0) {
|
||||
if (strstr($response,"OK")) {
|
||||
$this->connected = TRUE;
|
||||
return $response;
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue