CFile::getOwner PHP Method

getOwner() public method

Returned value depends upon $getName parameter value. If $_owner property is set, returned value is read from that property.
public getOwner ( boolean $get_name = True ) : integer | string | boolean
$get_name boolean Defaults to 'True', meaning that owner name instead of ID should be returned.
return integer | string | boolean Owner name, or ID if $getName set to 'False'
    public function getOwner($get_name = True)
    {
        if (!isset($this->_owner)) {
            $this->_owner = $this->getExists() ? fileowner($this->_realpath) : null;
        }
        if (is_int($this->_owner) && function_exists('posix_getpwuid') && $get_name == True) {
            $this->_owner = posix_getpwuid($this->_owner);
            $this->_owner = $this->_owner['name'];
        }
        return $this->_owner;
    }

Usage Example

Example #1
0
			<td align="right" nowrap="nowrap"><?php 
    echo $AppUI->_('Size');
    ?>
:</td>
			<td align="left" class="hilite"><?php 
    echo $obj->file_size;
    ?>
</td>
		</tr>
		<tr>
			<td align="right" nowrap="nowrap"><?php 
    echo $AppUI->_('Uploaded By');
    ?>
:</td>
			<td align="left" class="hilite"><?php 
    echo $obj->getOwner();
    ?>
</td>
		</tr>
	<?php 
}
?>
		<tr>
			<td align="right" nowrap="nowrap"><?php 
echo $AppUI->_('CO Reason');
?>
:</td>
			<td align="left">
				<textarea name="file_co_reason" class="textarea" rows="4" style="width:270px"><?php 
echo $obj->file_co_reason;
?>