PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » File Formats » Spreadsheet_Excel_Writer » Bug #9879

Worksheet::protect() shouldn't require a password.

Details

Request #9879Worksheet::protect() shouldn't require a password.
Submitted2007-01-19 15:45 UTC
Frommikej at primatech dot com
StatusOpen
PackageSpreadsheet_Excel_Writer
PHP Version4.3.9
OSCentos Linux 4.3
Roadmaps(Not assigned)

Comments

[2007-01-19 15:45 UTC] mikej at primatech dot com

Description:
------------
I want to protect a worksheet to prevent accidental formula overwrites, but I don't really want to password protect it. If I use Worksheet::protect(), I'm forced to give a password. It would be nice if the password was optional.

Here is a replacement function:

function protect($password = NULL)
{
$this->_protect = 1;
if ($password != NULL)
$this->_password = $this->_encodePassword($password);
}

I have worked around the problem for now by just setting the private member Worksheet::_protected to 1, but this is obviously not ideal.