Loading...
 

Unclear documentation of console.php

Status
Open
Subject
Unclear documentation of console.php
Version
21.x Regression
Category
  • Documentation (or Advocacy)
Feature
Console / Command Line
Resolution status
New
Submitted by
hman
Lastmod by
hman
Rating
(0)
Description

I had to break in in my test installation of Tiki 21.4 (set a temp admin pw I did not write down in my keepass).

For this scenario, there is a documentation available at
https://doc.tiki.org/Lost-admin-password

First, this document lacks the information, that console.php of a Tiki 21.4 needs to be run on at least PHP 7.1. That is not the default with every ISP, and it isn't with mine (Ionos/1&1, second largest hoster in Germany). If invoked as recommend this will yield:

<b>Parse error</b>: syntax error, unexpected T_STRING, expecting T_CONSTANT_ENCAPSED_STRING or '(' in <b>MYHOMEDIR/agim/tiki-21.4/console.php</b> on line <b>9</b><br />


Workaround is easy, in my case, the invokation of PHP needs to be "php7.1" instead of "php". But that's dependant on a users's ISP. But I think you should state the PHP level necessary.

But invoked as PHP 7.1, console.php still won't reset the admin pw, and only yields:

Only available through command-line.


This WAS run on a command line... Inspection of console.php shows an, IMHO, unreliable CLI detection mechanism. Line 21 reads:

if (http_response_code() !== false) { die('Only available through command-line.'); }


So http_response_code() is assumed to be false, if run on a command line. A quick test script:

<?php var_dump(http_response_code()); ?>


yields this:

int(200)


This is in line with the PHP documentation, which says on https://www.php.net/manual/de/function.http-response-code.php

"If response_code is provided, then the previous status code will be returned. If response_code is not provided, then the current status code will be returned. Both of these values will default to a 200 status code if used in a web server environment.

false will be returned if response_code is not provided and it is not invoked in a web server environment (such as from a CLI application). true will be returned if response_code is provided and it is not invoked in a web server environment (but only when no previous response status has been set). "

As I started both scripts definitely on a command line (Linux bash window running commandline SSH!) either PHP's detection is disturbed by something, or it only tests for the presence of a web server. This environment of course contains a web server (every Tiki installation will have that), but no distinction as to that HOW php got started (invocation on CLI or invocation by Apache) is done, so it defaults to 200.

So another, more reliable detection mechanism is needed here.

Thanks

Importance
3
Easy to solve?
9
Priority
27
Demonstrate Bug (Tiki 19+)
Please demonstrate your bug on show2.tikiwiki.org
 About show2.tikiwiki.org

To help developers solve the bug, we kindly request that you demonstrate your bug on a show2.tikiwiki.org instance. To start, simply select a version and click on "Create show2.tikiwiki.org instance". Once the instance is ready (in a minute or two), as indicated in the status window below, you can then access that instance, login (the initial admin username/password is "admin") and configure the Tiki to demonstrate your bug. Priority will be given to bugs that have been demonstrated on show2.tikiwiki.org.

Version: Create show2.tikiwiki.org instance
Ticket ID
8170
Created
Sunday 07 August, 2022 15:09:58 GMT-0000
by hman
LastModif
Sunday 07 August, 2022 22:09:43 GMT-0000

Attachments

 filenamecreatedhitscommentversionfiletype 
No attachments for this item


Keywords

The following is a list of keywords that should serve as hubs for navigation within the Tiki development and should correspond to documentation keywords.

Each feature in Tiki has a wiki page which regroups all the bugs, requests for enhancements, etc. It is somewhat a form of wiki-based project management. You can also express your interest in a feature by adding it to your profile. You can also try out the Dynamic filter.

Accessibility (WAI & 508)
Accounting
Administration
Ajax
Articles & Submissions
Backlinks
Banner
Batch
BigBlueButton audio/video/chat/screensharing
Blog
Bookmark
Browser Compatibility
Calendar
Category
Chat
Comment
Communication Center
Consistency
Contacts Address book
Contact us
Content template
Contribution
Cookie
Copyright
Credits
Custom Home (and Group Home Page)
Database MySQL - MyISAM
Database MySQL - InnoDB
Date and Time
Debugger Console
Diagram
Directory (of hyperlinks)
Documentation link from Tiki to doc.tiki.org (Help System)
Docs
DogFood
Draw -superseded by Diagram
Dynamic Content
Preferences
Dynamic Variable
External Authentication
FAQ
Featured links
Feeds (RSS)
File Gallery
Forum
Friendship Network (Community)
Gantt
Group
Groupmail
Help
History
Hotword
HTML Page
i18n (Multilingual, l10n, Babelfish)
Image Gallery
Import-Export
Install
Integrator
Interoperability
Inter-User Messages
InterTiki
jQuery
Kaltura video management
Karma
Live Support
Logs (system & action)
Lost edit protection
Mail-in
Map
Menu
Meta Tag
Missing features
Visual Mapping
Mobile
Mods
Modules
MultiTiki
MyTiki
Newsletter
Notepad
OS independence (Non-Linux, Windows/IIS, Mac, BSD)
Organic Groups (Self-managed Teams)
Packages
Payment
PDF
Performance Speed / Load / Compression / Cache
Permission
Poll
Profiles
Quiz
Rating
Realname
Report
Revision Approval
Scheduler
Score
Search engine optimization (SEO)
Search
Security
Semantic links
Share
Shopping Cart
Shoutbox
Site Identity
Slideshow
Smarty Template
Social Networking
Spam protection (Anti-bot CATPCHA)
Spellcheck
Spreadsheet
Staging and Approval
Stats
Survey
Syntax Highlighter (Codemirror)
Tablesorter
Tags
Task
Tell a Friend
Terms and Conditions
Theme
TikiTests
Timesheet
Token Access
Toolbar (Quicktags)
Tours
Trackers
TRIM
User Administration
User Files
User Menu
Watch
Webmail and Groupmail
WebServices
Wiki History, page rename, etc
Wiki plugins extends basic syntax
Wiki syntax text area, parser, etc
Wiki structure (book and table of content)
Workspace and perspectives
WYSIWTSN
WYSIWYCA
WYSIWYG
XMLRPC
XMPP




Useful Tools

Show PHP error messages